· 10 years ago · Oct 26, 2015, 04:03 PM
1require_relative'lib/hackex'
2require 'open-uri'
3n = 0
4puts "How many Accounts should I create?"
5num = gets.chomp
6while num.to_i >= n
7 rand_raw = open('http://api.randomuser.me/?gender=male?nat=us').read.delete!("\n")
8rand = JSON.parse(rand_raw)
9
10name = rand["results"][0]["user"]["username"].to_s.delete('results')
11pw = rand["results"][0]["user"]["password"]
12mail = name + "@gmail.com"
13 puts "Creating account #{n.to_s} of #{}num.to_s"
14 rand_raw = open('http://api.randomuser.me/?gender=male?nat=us').read.delete!("\n")
15rand = JSON.parse(rand_raw)
16
17name = rand["results"][0]["user"]["username"].to_s.delete('results')
18pw = rand["results"][0]["user"]["password"]
19mail = name + "@gmail.com"
20HackEx.LoginDo(T3TR!PCK3@gmail.com, !NFPCK20001) do |http, auth_token, user|
21 HackEx::Request.Do(http, HackEx::Request.CreateUser("name", "mail", " pw"))
22 open("accounts1.txt", 'a') { |f|
23 f << mail + ";" + pw
24 f << "\n"
25}
26 n += 1
27end
28end