Created
April 12, 2023 15:14
-
-
Save sironekotoro/d186da61f958d79d416f5b20075ec2a4 to your computer and use it in GitHub Desktop.
5ch のスレッド一覧を Web::Query で取得する
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
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