Skip to content

Instantly share code, notes, and snippets.

@toritori0318
Created February 19, 2014 09:45
Show Gist options
  • Save toritori0318/9088950 to your computer and use it in GitHub Desktop.
Save toritori0318/9088950 to your computer and use it in GitHub Desktop.
ircbot用lgtm
use strict;
use Web::Scraper;
use URI;
my $uri = URI->new('http://www.lgtm.in/g');
my $scraper = scraper {
process '//input[@id="imageUrl"]', 'image_url' => '@value';
process '//input[@id="dataUrl"]', 'data_url' => '@value';
};
my $result = $scraper->scrape($uri);
print $result->{image_url}, "\n";
print $result->{data_url}, "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment