Created
August 10, 2015 18:25
-
-
Save blizzarddreams/b23c5b5947a440d8e22b to your computer and use it in GitHub Desktop.
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
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