Skip to content

Instantly share code, notes, and snippets.

@Likk
Created April 6, 2012 09:38
Show Gist options
  • Save Likk/2318514 to your computer and use it in GitHub Desktop.
Save Likk/2318514 to your computer and use it in GitHub Desktop.
croudiaのIDが連番になっているので、最初の登校から順繰りぬきだすワンライナー
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