Created
July 29, 2011 11:29
-
-
Save arosh/1113649 to your computer and use it in GitHub Desktop.
AOJ solved_list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -Ku | |
require 'rexml/document' | |
require 'open-uri' | |
def getXMLDocument(user_id) | |
uri = "http://judge.u-aizu.ac.jp/onlinejudge/webservice/user?id=#{user_id}" | |
xml_source = open(uri).read | |
sleep(1) | |
return REXML::Document.new(xml_source) | |
end | |
doc = getXMLDocument('sho518') | |
doc.elements.each('user/solved_list/problem/id') do |pid| | |
puts pid.text.gsub("\n", "") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment