Skip to content

Instantly share code, notes, and snippets.

@nkpoid
Last active August 29, 2015 14:21
Show Gist options
  • Save nkpoid/ac3a32339454712bafb0 to your computer and use it in GitHub Desktop.
Save nkpoid/ac3a32339454712bafb0 to your computer and use it in GitHub Desktop.
『響け!ユーフォニアム』のアイコン取得する奴
require "open-uri"
require "nokogiri"
icons=[]
url = "http://anime-eupho.com/special/"
doc = Nokogiri::HTML.parse(open(url))
doc.css('img').each do |node|
path = node.attributes["src"].value
next if path !~ /special\/twitter\/thumb/
path.gsub!("thumb","icon").gsub!("jpg","png")
icons << "http://anime-eupho.com"+path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment