Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Network Outlet

by jwkrahn (Monsignor)
on Apr 28, 2012 at 03:21 UTC ( #967764=note: print w/ replies, xml ) Need Help??


in reply to Network Outlet

#!/usr/bin/perl # checkportopening.pl use strict; use LWP::Simple; use URI::Escape;

You should also have the warnings pragma in there somewhere.



# MEncoder location my $mencoder = "c:\\mplayer\mencoder.exe";

Interpolation will convert that string to: c:\mplayermencoder.exe



# Get the Port URL print "paste in a URL and Press Enter. \n% "; my $url = <STDIN>; # Scrape the page my $response = get($url);

You will probably need to chomp that $url variable before you use it.



# find the video file While ($response =~ m!videoURL\u003d(.*?)\\"!gis) { my $videoURL = $1; $videoURL = uri_unescape($videoURL); $videoURl =~ s!\\u003d!=!gs; # Find the site filename

You should probably put a } character somewhere at the end of that loop and the word 'While' is not valid Perl.



# make sure downloaded file is there if (-e $filename) { # change the extension my $newfilename = $filename; $newfilename =~ s!flv!avi!gis; print "Converting to $newfilename...\n"; # use MEncoder to convert to another file (rename intruder's site)

You should probably put a } character somewhere at the end of that block.


Comment on Re: Network Outlet
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967764]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2015-07-03 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls