Skip to content

Instantly share code, notes, and snippets.

@Kagee
Created April 21, 2012 02:15
Show Gist options
  • Save Kagee/2433286 to your computer and use it in GitHub Desktop.
Save Kagee/2433286 to your computer and use it in GitHub Desktop.
Get list of today's shows from on-my.tv
#! /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