Skip to content

Instantly share code, notes, and snippets.

@bayashi
Created December 15, 2012 10:12
Show Gist options
  • Save bayashi/4292477 to your computer and use it in GitHub Desktop.
Save bayashi/4292477 to your computer and use it in GitHub Desktop.
とあるページの画像だけ抜き出す Web App

とあるページの画像だけ抜き出す Web App

plack ワンライナー

plackup -MLWP::Simple=get -e 'sub { my $env = shift; my ($url) = ($env->{REQUEST_URI} =~ m!^/(.*)!); my @html; push(@html, qq|<img src="$_">|) for get($url) =~ m!<img[^>]*src="(https?://[^"]+)"[^>]*>!g; return [200, ["Content-Type" => "text/html"], [join("", @html) || "OK"]] }'

http://127.0.0.1:5000/http://matome.naver.jp/odai/2135350364969742801

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment