Skip to content

Instantly share code, notes, and snippets.

@bigwheel
Last active December 16, 2015 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigwheel/5433182 to your computer and use it in GitHub Desktop.
Save bigwheel/5433182 to your computer and use it in GitHub Desktop.
Magic: the Gatheringカードメージギャラリーから@wikiフォーマットでドラフト点数表のテンプレートを作る
#!/bin/env ruby
# -*- coding: utf-8 -*-
require 'open-uri'
require 'nokogiri'
require 'pry'
doc = Nokogiri::HTML(open('http://www.wizards.com/magic/tcg/article.aspx?' +
'x=mtg/tcg/dragonsmaze/cig',
'Accept-Language' => 'ja,en-US;q=0.8,en;q=0.6'))
image_tags = doc.xpath('//div[@id="bycolor"]//img[contains(@src,"http://media.wizards.com/images/magic/tcg/products/dgm/")]')
image_tags.each do |item|
puts "#areaedit()"
puts "*** #{item.attr('alt')}"
puts "#image(#{item.attr('src')},right)"
puts '#comment(title_msg=点数とコメント:)'
puts '#areaedit(end)'
puts '----'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment