It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
class Account
attr_accessor :email, :hash
def initialize(email, hash)
@email = email
@hash = hash
end
end
contents = File.open("accounts.txt", "r").read
count = 0
accounts = {}
contents.split("\n").each_with_index do |line, index|
match = line.match(/.*,.*,(.*),(.*)/)
next if match[1].empty?
# Screw lame 'n easy unsalted hashes
next if !match[2].strip.match(/\$1\$.{8}\$.{22}$/)
# Get the email domain
domain_match = match[1].strip.match(/@(.*)$/)
next if !domain_match
domain = domain_match[1]
# Drop some domains
next if ["gmail.com", "googlemail.com"].include?(domain)
# List the accounts per domain
accounts[domain] ||= []
accounts[domain] << Account.new(match[1], match[2])
count +=1
end
puts "Found #{count}"
exit if !ARGV.include?("--write")
# Get the top 10 of domains
if ARGV.include?("--limit")
domains = accounts.keys.sort{|a,b| accounts[a].count <=> accounts[b].count}[-10..-1]
wanted_accounts = domains.map{|domain| accounts[domain]}.flatten
else
wanted_accounts = accounts.values.flatten
end
# Devide and conquer
parts = 4
current_part = nil
result_file = nil
wanted_accounts.each_with_index do |account, index|
should_be_on_part = index/(wanted_accounts.count / parts)
# Second condition is for dirty integer devision spilling over
if current_part != should_be_on_part && (!current_part || current_part < (parts - 1))
puts "Changing. Now on: #{index}. Opening: hashes_#{should_be_on_part}.txt"
result_file.close if result_file
result_file = File.open("hashes_#{should_be_on_part}.txt", "w")
current_part = should_be_on_part
end
result_file.puts(account.hash)
end