Skip to content

Instantly share code, notes, and snippets.

@zunda
Forked from yusuke/gist:2641452
Created May 9, 2012 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zunda/2641479 to your computer and use it in GitHub Desktop.
Save zunda/2641479 to your computer and use it in GitHub Desktop.
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
@zunda
Copy link
Author

zunda commented May 9, 2012

open(url)のあたりは https://gist.github.com/2641537 を参考にさせていただきました

@zunda
Copy link
Author

zunda commented May 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment