Created
April 6, 2012 09:38
-
-
Save Likk/2318514 to your computer and use it in GitHub Desktop.
croudiaのIDが連番になっているので、最初の登校から順繰りぬきだすワンライナー
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
perl -MLWP -e 'my $ua = LWP::UserAgent->new; for my $n (1..400){ my $r = $ua->get(q{http://croudia.com/voices/show/}.$n); my $h = Encode::encode_utf8($r->decoded_content); $h =~ s{\n}{}g; my $line = ""; if($h =~ m{<span class="gray">([0-9].*?)</span>}){ $line .= $1. "\t"} if($h =~ m{<span class="gray">(.*?)</span>}){ $line.= $1. "\t" } if($h =~ m{<div style="background-color:#FFF;">(.*?)<br}){ $line.= $1} if($line ne q{}){print "${n}\t${line}\n"}; sleep 1 ; }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment