Created
April 21, 2012 02:15
-
-
Save Kagee/2433286 to your computer and use it in GitHub Desktop.
Get list of today's shows from on-my.tv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
use warnings; | |
use strict; | |
use LWP::Simple; | |
use XML::XPath; | |
use XML::XPath::XMLParser; | |
my $file = 'today.xml'; | |
unlink($file); | |
my $url = 'http://today.on-my.tv/?xml'; | |
getstore($url, $file); | |
my $xp = XML::XPath->new(filename => 'today.xml'); | |
my $nodeset = $xp->find('/tvdata/episodes/entry/show_name'); # find all paragraphs | |
my @shows; | |
foreach my $node ($nodeset->get_nodelist) { push(@shows, $node->string_value); } | |
print join(", ", @shows); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment