Zen with Xen + a terrible perl program

I know I am very late to the Xen party. I try to stay on top of the life changing software, but there have just been so many new things out there over the past two years or so. I tried running a Xen kernel a while back under fedora core 6, but there were serious problems with xen and the ivtv kernel module driving my pvr500. I was using that for my mythtv backend, which the wife had gotten used to. Guess which had to go. FF >> 2007. I am priming my hardware for a complete replacement, and have already ebayed the tuner card. I figured what the heck; I have a free afternoon. Why not install a xen kernel, and experiment? Good times. Between xen and perl I blew the weekend. I started to write a screen scraper for surfthechannel.com but I got bored. Here is what I have so far….

camel

#!/usr/bin/perl
#use strict;

use WWW::Mechanize;
use HTML::TokeParser;

my $agent = WWW::Mechanize->new();
$agent->get("http://surfthechannel.com/");
$agent->follow_link(text => 'TV', n => 1);

my @tvlinks = $agent->find_all_links(url_regex => qr[/show/television/.]);

print "1. Connecting to surfthechannel.com\n";
for my $tvlink (@tvlinks) {
my $tvlinktext = $tvlink->text;
my $tvlinkurl = $tvlink->url;
}

$agent->follow_link(text => 'episodes');
my @showlinks = $agent->find_all_links(url_regex => qr[/show/television/.]);

print "2. Getting list of available shows\n";
foreach $showlink (@showlinks) {
my $showlinktext = $showlink->text;
my $showlinkurl = $showlink->url;
@showtext = split (/\d episodes$/, $showlinktext);
print "@showtext\n";
$agent->follow_link(url_regex => qr[/info/television/.]);
my @episodelinks = $agent->find_all_links(url_regex => qr[/watch/television/.]);

# print "3. Getting list of available $showlinktext \n\n";
foreach $episodelink (@episodelinks) {
my $epispdetitle = $agent->title();
my $episodetext = $episodelink->text;
my $episodelinkurl = $episodelink->url;
#print "$episodetext\n";
print "$episodelinkurl\n";
print "---------------------------------\n";
}
}

Its not done, and it doesn’t work yet but I’ll probably never come back to it so here it is under GPL.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.