require 'rosettacode'

langs = []
RosettaCode.category_members() {|lang| langs << lang}



langcount = {}
langs.each_slice(20) do |sublist|
  url = RosettaCode.get_api_url({
     => ,
     => ,
     => ,
     => sublist.join(),
  })

  doc = REXML::Document.new open(url)
  REXML::XPath.each(doc, ) do |page|
    lang = page.attribute().value
    info = REXML::XPath.first(page, )
    langcount[lang] = info.nil?? 0: info.attribute().value.to_i
  end
end

puts Time.now
puts 
puts 
langcount.sort_by {|key,val| val}.reverse[0,25].each_with_index do |(lang, count), i|
  puts 
end