Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sironekotoro/d186da61f958d79d416f5b20075ec2a4 to your computer and use it in GitHub Desktop.
Save sironekotoro/d186da61f958d79d416f5b20075ec2a4 to your computer and use it in GitHub Desktop.
5ch のスレッド一覧を Web::Query で取得する
use strict;
use warnings;
use HTTP::Tiny;
use Encode qw/decode/;
use Web::Query;
my $temp = HTTP::Tiny->new->get('https://hayabusa9.5ch.net/news/');
my $str = decode('ShiftJIS' , $temp->{content} );
wq($str)
->find('h3')
->each(
sub {
my $i = shift;
printf("%d %s\n", $i+1, $_->text);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment