Skip to content

Commit

Permalink
some changes ... but prepare for the massive re-write
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbrutti committed Oct 13, 2009
1 parent 0c36450 commit 936c591
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 53 deletions.
4 changes: 2 additions & 2 deletions README.rdoc
Expand Up @@ -80,7 +80,7 @@ or in the more classic way in which you can create an Esearchy objetc and work o
domain.save_to_file "~/emails.txt"

We now also have a LinkedIn search which looks for Names in the site. With those names it
* creates emails based on those emails.
* creates emails based on those names.
* searches Google and Yahoo for emails related to those people.

ESearchy.create "domain.com" do |d|
Expand Down Expand Up @@ -116,7 +116,7 @@ Not short of that now, we also have the possibility of choosing between a Librar

== INSTALL:
* > sudo gem sources -a http://gems.github.com (If you do not have the repository)
* > sudo gem install freedomcoder-esearchy
* > sudo gem install FreedomCoder-esearchy

== THANKS:

Expand Down
12 changes: 5 additions & 7 deletions TODO
Expand Up @@ -2,8 +2,6 @@ TO DO
-----

GLOBAL:
- IMPORTANT: Add UTF-16 support in Ruby 1.9 :) It would be very interesting to search for emails in that way.

- [COMPLETED] Implement a better way to read the AppID keys for yahoo and Bing.
- [COMPLETED] Make it possible to suppy the total of desires hits.
- [COMPLETED] Implement a more open regex that will cover cases such as
Expand All @@ -12,19 +10,17 @@ GLOBAL:
- user at domain dot com
- [BUG] It returns some strings that are not emails.
Checking regext to fine-tune it to avoid this false pasitivs

- [COMPLETED] Add LinkedIn Support.
- Fetch results into Yahoo People to obtain possible emails accounts.
[SOLVED][BUG] - This will return the users' vcard. Need to find some way to fix this.

- Add other social network sites ( I need to research on this)
- [COMPLETED] Added BugMeNot class that allows uses to fetch from bug_me_not user credentials.
- [COMPLETED] Add Random User-Agent support for Search Engines to prevent from being banned.
- Add Random sleep times to avoid being banned.
- [FIXED] ESearchy crashed when an URI for a PDF contained a white space.
- [FIXED] ESearchy::BUGMENOT was not handling correctly on Backtrack live CD.
- [COMPLETED] Add an ESearchy::DELAY Constant. This could be overwritten and setup a new delay.

- Add Random sleep times to avoid being banned.
- IMPORTANT: Add UTF-16 support in Ruby 1.9 :) It would be very interesting to search for emails in that way.
- Add other social network sites ( I need to research on this)
LINUX/UNIX/OSX:
- [COMPLETED] Add support for .doc in unix platforms. (Through antiword) It would be nice to take a
look at the implementation and see if we can create a method to read files, independently
Expand All @@ -38,3 +34,5 @@ WINDOWS:
- [FIXED][BUG] Windows Vista with Ruby One click installer 3.0 does not support String.first so now
we use String[range] (name[0,1])

FEATURE REQUEST:
- Add session handling. ( recover last scan, etc ...)
7 changes: 4 additions & 3 deletions bin/esearchy 100644 → 100755
Expand Up @@ -2,7 +2,8 @@

require 'rubygems'
require 'getoptlong'
require 'esearchy'
require '../lib/esearchy.rb'

ESearchy::LOG.level = ESearchy::APP

@yahoo_key = nil
Expand Down Expand Up @@ -123,12 +124,12 @@ opts.each do |opt, arg|
end
end

require 'esearchy'
puts "DISCLOSURE: This is just an example tool ESearchy is more and more a piece
of code intended to work as a Library and you should create your own little.rb file :)"
puts "------------------------------------------------------------------------"
puts "REMINDER: if you want to use GoogleProfiles, LinkedIn or Naymz, you will
need to use the --company (-c) <company_name> option"

@domains.each_with_index do |domain, idx|
ESearchy.create domain do |d|
@no_eng.each do |eng,val|
Expand All @@ -143,7 +144,7 @@ need to use the --company (-c) <company_name> option"
d.linkedin_credentials = ESearchy::BUGMENOT
end
d.company_name = @company[idx] unless @company.empty?
d.search
d.save_to_file @output if @output
d.search
end
end
2 changes: 1 addition & 1 deletion esearch.gemspec
@@ -1,6 +1,6 @@
SPEC = Gem::Specification.new do |s|
s.name = "esearchy"
s.version = "0.1.2.2"
s.version = "0.1.2.3"
s.author = "Matias P. Brutti"
s.email = "matiasbrutti@gmail.com"
s.homepage = "http://freedomcoder.com.ar/esearchy"
Expand Down
18 changes: 14 additions & 4 deletions lib/esearchy.rb
Expand Up @@ -30,6 +30,7 @@ def log_type=(value)
def log_file=(value)
ESearchy::LOG.file = value
end

# Need to find another way of fixing this.
#def delay=(value)
# ESearch::DELAY = value
Expand Down Expand Up @@ -71,6 +72,7 @@ def search(query=nil)
e.search(query || @query)
e.search_depth if depth_search?
LOG.puts "+--- Finishing Search for #{n} ---+\n"
write_to_file if @file
end
end
# retrieve emails
Expand Down Expand Up @@ -173,10 +175,17 @@ def search_#{engine}=(value)
end"
end
## Saving methods
def save_to_file(file, list=nil)
open(file,"a") do |f|
list ? list.each { |e| f << e + "\n" } : emails.each { |e| f << e + "\n" }
end
def save_to_file(file)
@file = File.new(file,"a")
@file.sync = true
return 0
end

def write_to_file(list=nil)
#open(@file,"a") do |f|
# list ? list.each { |e| f << e + "\n" } : emails.each { |e| f << e + "\n" }
#end
list ? list.each { |e| @file << e + "\n" } : emails.each { |e| @file << e + "\n" }
end

def save_to_sqlite(file)
Expand Down Expand Up @@ -209,6 +218,7 @@ def calculate_score(email)
score = score + 0.2 if email =~ /#{@query}/
score = score + 0.3 if verify_domain!(email)
score = 1.0 if verify_email!(email)
return score
end

def depth_search?
Expand Down
9 changes: 8 additions & 1 deletion lib/esearchy/OtherEngines/googlegroups.rb
Expand Up @@ -17,7 +17,14 @@ def initialize(maxhits = nil, start = nil)
@lock = Mutex.new
@threads = []
end
attr_accessor :emails

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
9 changes: 8 additions & 1 deletion lib/esearchy/OtherEngines/pgp.rb
Expand Up @@ -10,7 +10,14 @@ def initialize(maxhits=0)
@emails = []
@lock = Mutex.new
end
attr_accessor :emails

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
9 changes: 8 additions & 1 deletion lib/esearchy/OtherEngines/usenet.rb
Expand Up @@ -10,7 +10,14 @@ def initialize(maxhits=0)
@emails = []
@lock = Mutex.new
end
attr_accessor :emails

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
9 changes: 8 additions & 1 deletion lib/esearchy/SearchEngines/altavista.rb
Expand Up @@ -17,7 +17,14 @@ def initialize(maxhits = 0, start = 0)
@lock = Mutex.new
@threads = []
end
attr_accessor :emails

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
10 changes: 9 additions & 1 deletion lib/esearchy/SearchEngines/bing.rb
Expand Up @@ -18,7 +18,15 @@ def initialize(maxhits=0, appid=nil, start=0)
@r_txts = Queue.new
@lock = Mutex.new
end
attr_accessor :emails, :appid
attr_accessor :appid

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
9 changes: 8 additions & 1 deletion lib/esearchy/SearchEngines/google.rb
Expand Up @@ -17,7 +17,14 @@ def initialize(maxhits = 0, start = 0)
@lock = Mutex.new
@threads = []
end
attr_accessor :emails

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
10 changes: 9 additions & 1 deletion lib/esearchy/SearchEngines/yahoo.rb
Expand Up @@ -18,7 +18,15 @@ def initialize(maxhits=0, appid = nil, start=0)
@threads = []
@lock = Mutex.new
end
attr_accessor :emails, :appid
attr_accessor :appid

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def search(query)
@query = query
Expand Down
18 changes: 17 additions & 1 deletion lib/esearchy/SocialNetworks/googleprofiles.rb
Expand Up @@ -22,7 +22,23 @@ def initialize(maxhits = 0, start = 0)
@lock = Mutex.new
@threads = []
end
attr_accessor :emails, :company_name, :people
attr_accessor :company_name

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def people
@people.uniq!
end

def people=(value)
@people=value
end

def search(query)
@query = query
Expand Down
18 changes: 17 additions & 1 deletion lib/esearchy/SocialNetworks/linkedin.rb
Expand Up @@ -18,7 +18,23 @@ def initialize(maxhits = 0)
@company_name = nil
@cookie = nil
end
attr_accessor :emails, :username, :password, :company_name, :people
attr_accessor :username, :password, :company_name, :people

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def people
@people.uniq!
end

def people=(value)
@people=value
end

def login
begin
Expand Down
23 changes: 20 additions & 3 deletions lib/esearchy/SocialNetworks/naymz.rb
Expand Up @@ -20,7 +20,23 @@ def initialize(maxhits = 0, start = 0)
@lock = Mutex.new
@threads = []
end
attr_accessor :emails, :company_name, :people
attr_accessor :company_name

def emails
@emails.uniq!
end

def emails=(value)
@emails=value
end

def people
@people.uniq!
end

def people=(value)
@people=value
end

def search(query)
@query = query
Expand Down Expand Up @@ -86,8 +102,9 @@ def parse(html)
end
name,last = person.size > 2 ? [person[0],person[-1]] : person
@people << person
@emails << "#{name.split(' ')[0]}.#{last.split(' ')[0]}#{@domain}"
@emails << "#{name[0,1]}#{last.split(' ')[0]}#{@domain}"
@emails << "#{name.split(' ')[0] unless name.nil?}" +
".#{last.split(' ')[0] unless last.nil?}#{@domain}"
@emails << "#{name[0,1] unless name.nil?}#{last.split(' ')[0] unless last.nil?}#{@domain}"
#@emails.concat(fix(search_person(name,last)))
@emails.uniq!
print_emails(@emails)
Expand Down

0 comments on commit 936c591

Please sign in to comment.