Cool uses for Perl, I added two routers to my network, one to act as a gate, two to act as computer during the day and router or gate at night. Because I could not find code to make this router invisible to catch logins ONLY at night. I used a schedule sort of like a slave of the main router close to the modem T1 power up. I feel that I'm being "swiss army knife", becuase I could not stop trojans with NORTON'S Greatest.
#!/usr/bin/perl
# checkportopening.pl
use strict;
use LWP::Simple;
use URI::Escape;
# MEncoder location
my $mencoder = "c:\\mplayer\mencoder.exe";
# Get the Port URL
print "paste in a URL and Press Enter. \n% ";
my $url = <STDIN>;
# Scrape the page
my $response = get($url);
# 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
my $head = head($videoURL);
my $filename = $head->{_headers}->{'content-disposition'};
$filename =~ s!attachment; filename||gis;
# Download the video file
print "Downloading $filename...\n";
getstore($videoURL,$filename);
# 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)
my $cmd = "$mencoder $filename -ofps 15";
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|