Skip to content

Instantly share code, notes, and snippets.

@bigwheel bigwheel/main.rb
Last active Dec 16, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.