Last active
November 2, 2015 00:29
-
-
Save xjackk/1081034747938446f2dd to your computer and use it in GitHub Desktop.
teamliquid top stream scraper
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 | |
# TL stream scraper ! | |
use strict; | |
use URI; | |
use LWP::Simple; | |
use Web::Scraper; | |
use Data::Dumper; | |
use Encode; | |
my $teamliquid = "http://www.teamliquid.net"; | |
my $content = scraper { | |
process "div#streams_content div", "streams[]" => scraper { | |
process "a.rightmenu", streamer => 'TEXT'; | |
process "span.viewers", viewers => 'TEXT'; | |
}; | |
}; | |
my $res = $content->scrape(URI->new($teamliquid)); | |
#print Dumper($res); | |
print "\n\t Team Liquid Top Streamers \n\n"; | |
print "\t ----------------------------\n\n"; | |
for my $shit (@{$res->{streams}}) { | |
print "Streamer : " . $shit->{streamer} . "\t"; | |
print "\t"; | |
print "# of viewers : " . $shit->{viewers}; | |
print "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment