-
-
Save zunda/2641479 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 "open-uri" | |
urls = %w( | |
http://pastebin.com/raw.php?i=Kc9ng18h | |
http://pastebin.com/raw.php?i=vCMndK2L | |
http://pastebin.com/raw.php?i=JdQkuYwG | |
http://pastebin.com/raw.php?i=fw43srjY | |
) | |
passwords = Hash.new{|h, k| h[k] = Array.new} | |
urls.each do |url| | |
open(url).each_line do |line| | |
username, password = line.chomp.split(/:/, 2) | |
passwords[username] << password | |
end | |
end | |
lookfor = Regexp.new(ARGV.map{|s| Regexp.escape(s)}.join('|'), Regexp::IGNORECASE) | |
passwords.keys.select{|username| username =~ lookfor}.each do |username| | |
puts "#{username}:#{passwords[username].uniq.join(':')}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
open(url)のあたりは https://gist.github.com/2641537 を参考にさせていただきました