#!/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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|