Last active
December 11, 2015 04:28
-
-
Save xjackk/20553a1d8268149a6cd6 to your computer and use it in GitHub Desktop.
boomerang tv listings
This file contains 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 -w | |
# List Boomerang tv listings | |
use strict; | |
use URI; | |
use LWP::Simple; | |
use Web::Scraper; | |
use Data::Dumper; | |
use Encode; | |
# Listing site | |
# Boomerang! | |
my $schedule = "http://www.locatetv.com/listings/boomerang"; | |
# scrapin' with Web::Scraper. | |
my $shows = scraper { | |
process "li.schedTv", "shows[]" => scraper { | |
process "a.pickable", title => 'TEXT'; | |
process "li.time", "times" => 'TEXT'; | |
}; | |
}; | |
# print res | |
my $res = $shows->scrape(URI->new($schedule)); | |
# dumper for debuggin' | |
#print Dumper($res); | |
# Pretty stylin' | |
print "\n\t Boomerang TV Listings\n\n"; | |
print "\t -----------------------\n\n"; | |
for my $shows (@{$res->{shows}}) { | |
print $shows->{title}; | |
print "\t-- " . $shows->{times}; | |
print "\n\n"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment