Skip to content

Instantly share code, notes, and snippets.

@notblizzard
Created August 10, 2015 18:25
Show Gist options
  • Save notblizzard/b23c5b5947a440d8e22b to your computer and use it in GitHub Desktop.
Save notblizzard/b23c5b5947a440d8e22b to your computer and use it in GitHub Desktop.
require 'faraday'
require 'json'
unregged = []
threads = []
data = Faraday.get("url_to_text_goes_here").body
data.each_line do |element|
puts element
threads << Thread.new {
url = "http://pokemonshowdown.com/users/#{element.strip}.json"
data = JSON.parse(Faraday.get(url).body)
if data['registertime'] == 0
unregged << element[1]
end
}
end
threads.map(&:join)
puts "unregged is #{unregged}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment