esearchy 0.2.0 → 0.2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -1
- data/bin/esearchy +62 -43
- data/lib/esearchy/OtherEngines/usenet.rb +1 -1
- data/lib/esearchy/esearchy.rb +2 -2
- data/lib/esearchy/otherengines.rb +1 -1
- data/lib/esearchy.rb +1 -1
- metadata +3 -13
data/README.rdoc
CHANGED
@@ -56,6 +56,7 @@ For now, there are two main ways of performing a search:
|
|
56
56
|
|
57
57
|
* Executable CLI command
|
58
58
|
|
59
|
+
esearchy -h
|
59
60
|
|
60
61
|
* Library
|
61
62
|
|
@@ -73,7 +74,8 @@ For thouse who want to integrate this to their application you can use it in "th
|
|
73
74
|
|
74
75
|
== INSTALL:
|
75
76
|
* > sudo gem sources -a http://gems.github.com (If you do not have the repository)
|
76
|
-
* > sudo gem install
|
77
|
+
* > sudo gem install gemcutter
|
78
|
+
* > sudo gem install esearchy
|
77
79
|
|
78
80
|
== THANKS:
|
79
81
|
|
data/bin/esearchy
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -wKU
|
2
3
|
# esearchy
|
3
4
|
#
|
4
5
|
# Created by FreedomCoder on 2009-10-24.
|
5
6
|
# Copyright 2009 FreedomCoder's Labs. All rights reserved.
|
6
7
|
#
|
8
|
+
|
7
9
|
if RUBY_PLATFORM =~ /mingw|mswin/
|
8
10
|
require 'Win32API'
|
9
11
|
class Wcol
|
10
12
|
gsh = Win32API.new("kernel32", "GetStdHandle", ['L'], 'L')
|
11
13
|
@textAttr = Win32API.new("kernel32","SetConsoleTextAttribute", ['L','N'], 'I')
|
12
14
|
@h = gsh.call(-11)
|
13
|
-
|
15
|
+
|
14
16
|
def self.color(col)
|
15
17
|
@textAttr.call(@h,col)
|
16
18
|
end
|
@@ -26,11 +28,10 @@ end
|
|
26
28
|
|
27
29
|
require 'rubygems'
|
28
30
|
require 'getoptlong'
|
29
|
-
require 'sqlite3'
|
30
|
-
require 'prawn'
|
31
|
+
require 'sqlite3' rescue raise "gem install sqlite3"
|
32
|
+
require 'prawn' rescue raise "gem install prawn"
|
31
33
|
require 'prawn/layout'
|
32
|
-
|
33
|
-
require '../lib/esearchy.rb'
|
34
|
+
require 'esearchy'
|
34
35
|
|
35
36
|
ESearchy::log = true
|
36
37
|
|
@@ -40,8 +41,9 @@ ESearchy::log = true
|
|
40
41
|
@params = {}
|
41
42
|
@list = []
|
42
43
|
@output = nil
|
43
|
-
|
44
|
-
@
|
44
|
+
|
45
|
+
@email_engines = [:Google, :Bing, :Yahoo, :Altavista, :PGP, :Spider ,:Usenet, :GoogleGroups ]
|
46
|
+
@people_engines = [:LinkedIn, :Naymz, :Classmates, :GoogleProfiles]
|
45
47
|
|
46
48
|
opts = GetoptLong.new(
|
47
49
|
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
|
@@ -71,7 +73,7 @@ opts.each do |opt, arg|
|
|
71
73
|
case opt
|
72
74
|
when '--help':
|
73
75
|
# BEGIN OF HELP
|
74
|
-
|
76
|
+
puts "\nHELP for Esearchy\n---------------------\n
|
75
77
|
--help, -h
|
76
78
|
\tWell I guess you know what this is for (To obtain this Help).\n
|
77
79
|
INPUT PARAMS:
|
@@ -113,6 +115,10 @@ opts.each do |opt, arg|
|
|
113
115
|
Copyright 2009 - FreedomCoder\n"
|
114
116
|
#END OF HELP
|
115
117
|
exit(0)
|
118
|
+
when '--disable-people':
|
119
|
+
@people_engines = []
|
120
|
+
when '--disable-emails':
|
121
|
+
@email_engines = []
|
116
122
|
when '--disable-google':
|
117
123
|
@email_engines.delete(:Google)
|
118
124
|
when '--disable-yahoo':
|
@@ -141,9 +147,11 @@ opts.each do |opt, arg|
|
|
141
147
|
@params[:query] = arg
|
142
148
|
when '--company':
|
143
149
|
@params[:company] = arg
|
150
|
+
when '--website':
|
151
|
+
@params[:website] = arg
|
144
152
|
when '--file':
|
145
153
|
if File.exists?(arg)
|
146
|
-
open(arg,'r').each_line do |line|
|
154
|
+
File.open(arg,'r').each_line do |line|
|
147
155
|
temp[:query],temp[:company],temp[:website] = line.split(',')
|
148
156
|
@list << temp
|
149
157
|
end
|
@@ -168,24 +176,24 @@ opts.each do |opt, arg|
|
|
168
176
|
end
|
169
177
|
|
170
178
|
|
171
|
-
def configure(maxhits =
|
172
|
-
File.
|
173
|
-
line << "MAXHITS
|
174
|
-
line << "YAHOOKEY
|
175
|
-
line << "BINGKEY
|
179
|
+
def configure(maxhits = nil, yahoo_key = nil, bing_key = nil)
|
180
|
+
File.open(ENV['HOME'] + "/.esearchyrc", "w" ) do |line|
|
181
|
+
line << "MAXHITS=#{maxhits.to_s || "500"}\n"
|
182
|
+
line << "YAHOOKEY=#{yahoo_key.to_s}\n" if yahoo_key
|
183
|
+
line << "BINGKEY=#{bing_key.to_s}\n" if bing_key
|
176
184
|
end
|
177
185
|
end
|
178
186
|
|
179
187
|
def read_conf
|
180
|
-
File.
|
188
|
+
File.open(ENV['HOME'] + "/.esearchyrc").readlines.each do |line|
|
181
189
|
key, value = line.split("=")
|
182
190
|
case key
|
183
191
|
when "MAXHITS"
|
184
|
-
@params[:maxhits] ||= value
|
192
|
+
@params[:maxhits] ||= value.to_i
|
185
193
|
when "YAHOOKEY"
|
186
194
|
@yahoo_key ||= value
|
187
195
|
when "BINGKEY"
|
188
|
-
@bing_key
|
196
|
+
@bing_key ||= value
|
189
197
|
end
|
190
198
|
end
|
191
199
|
end
|
@@ -196,20 +204,25 @@ end
|
|
196
204
|
|
197
205
|
### PRINTING FINDING METHODS ###
|
198
206
|
def print_(list)
|
199
|
-
list.
|
200
|
-
|
201
|
-
case
|
202
|
-
when
|
203
|
-
|
204
|
-
|
205
|
-
|
207
|
+
unless list.nil?
|
208
|
+
list.each do |item|
|
209
|
+
case item
|
210
|
+
when String
|
211
|
+
case RUBY_PLATFORM
|
212
|
+
when /mingw|mswin/
|
213
|
+
print_windows(item)
|
214
|
+
when /linux|darwin/
|
215
|
+
print_linux(item)
|
216
|
+
end
|
217
|
+
when Array
|
218
|
+
puts item.join " "
|
206
219
|
end
|
207
220
|
end
|
208
221
|
end
|
209
222
|
end
|
210
223
|
|
211
224
|
def print_linux(email)
|
212
|
-
if email.match(/#{
|
225
|
+
if email.match(/#{ESearchy::Search.query.gsub("@","").split('.')[0]}/)
|
213
226
|
puts "\033[31m" + email + "\033\[0m"
|
214
227
|
else
|
215
228
|
puts "\033[32m" + email + "\033\[0m"
|
@@ -217,7 +230,7 @@ def print_linux(email)
|
|
217
230
|
end
|
218
231
|
|
219
232
|
def print_windows(email)
|
220
|
-
if email.match(/#{
|
233
|
+
if email.match(/#{ESearchy::Search.query.gsub("@","").split('.')[0]}/)
|
221
234
|
Wcol::puts(12, email)
|
222
235
|
else
|
223
236
|
Wcol::puts(2, email)
|
@@ -226,7 +239,6 @@ end
|
|
226
239
|
|
227
240
|
### SAVING TO DISK ###
|
228
241
|
class Output
|
229
|
-
|
230
242
|
def initialize(name)
|
231
243
|
@output = name
|
232
244
|
end
|
@@ -246,10 +258,7 @@ class Output
|
|
246
258
|
def save_csv(data)
|
247
259
|
out = File.new(name, "w")
|
248
260
|
out << "EMAILS/PERSON, TYPE, CLASS, MATCH\n"
|
249
|
-
data.each
|
250
|
-
out << r.each { |x| x
|
251
|
-
end
|
252
|
-
|
261
|
+
data.each { |r| out << r.each { |x| x }}
|
253
262
|
end
|
254
263
|
|
255
264
|
def save_pdf(data)
|
@@ -262,6 +271,7 @@ class Output
|
|
262
271
|
:font_size => 10,
|
263
272
|
:vertical_padding => 2,
|
264
273
|
:horizontal_padding => 5
|
274
|
+
end
|
265
275
|
end
|
266
276
|
|
267
277
|
def save_sqlite(data)
|
@@ -284,18 +294,18 @@ end
|
|
284
294
|
def execute(p)
|
285
295
|
if p[:query]
|
286
296
|
search = ESearchy::Search.new(p)
|
287
|
-
|
297
|
+
|
288
298
|
search.start do |s|
|
289
299
|
s.Emails(@email_engines) do |e|
|
290
300
|
e.Yahoo.appid= @yahoo_key if @yahoo_key
|
291
|
-
e.Bing.appid= @bing_key if @bing_key
|
292
|
-
e.search do |
|
293
|
-
dump(
|
294
|
-
print_(
|
301
|
+
e.Bing.appid= @bing_key if @bing_key
|
302
|
+
e.search do |x|
|
303
|
+
dump(x.results)
|
304
|
+
print_(x.emails.uniq)
|
295
305
|
end
|
296
|
-
e.docs do |
|
297
|
-
dump(
|
298
|
-
print_(
|
306
|
+
e.docs do |x|
|
307
|
+
dump(x.results)
|
308
|
+
print_(x.emails.uniq)
|
299
309
|
end
|
300
310
|
end
|
301
311
|
|
@@ -303,13 +313,21 @@ def execute(p)
|
|
303
313
|
p.search { |p| dump(p.results) }
|
304
314
|
end
|
305
315
|
end
|
306
|
-
@output.save(search.results)
|
307
|
-
puts "-------RESULTS--------"
|
316
|
+
@output.save(search.results) if @output
|
317
|
+
puts "-------FINAL RESULTS--------"
|
308
318
|
print_ search.emails
|
309
319
|
print_ search.people
|
310
320
|
end
|
311
321
|
end
|
312
322
|
|
323
|
+
puts "\033[31m------------------------------------------------------------------------------\033\[0m"
|
324
|
+
puts "\033[31m ||---- \033\[0m //--- ||---- __ //----\\\\ //--- || || \\\\ // "
|
325
|
+
puts "\033[31m || \033\[0m // || // \\\\ || \\\\ // || || \\\\//"
|
326
|
+
puts "\033[31m ||---- \033\[0m \\\\ ||---- // \\\\ ||----// || ||-----|| // "
|
327
|
+
puts "\033[31m || \033\[0m \\\\ || //-----\\\\ || \\\\ \\\\ || || //"
|
328
|
+
puts "\033[31m ||---- \033\[0m ---// ||---- // \\\\ || \\\\ \\\\--- || || // "
|
329
|
+
puts "\033[31m------------------------------------------------------------------------------\033\[0m"
|
330
|
+
puts "\n"
|
313
331
|
puts "DISCLOSURE: This is just an example tool ESearchy is more and more a piece
|
314
332
|
of code intended to work as a Library and you should create your own little.rb file :)"
|
315
333
|
puts "------------------------------------------------------------------------"
|
@@ -331,4 +349,5 @@ end
|
|
331
349
|
unless @params.empty?
|
332
350
|
execute(@params)
|
333
351
|
end
|
334
|
-
puts "
|
352
|
+
puts "\n------------------------"
|
353
|
+
puts "Happy Hacking :)\nGood Bye.\n"
|
data/lib/esearchy/esearchy.rb
CHANGED
@@ -136,7 +136,7 @@ module ESearchy
|
|
136
136
|
def initialize(*args, &block)
|
137
137
|
@engines={}
|
138
138
|
@documents = []
|
139
|
-
args.each do |e|
|
139
|
+
(args[0].instance_of?(Array) ? args[0] : args).each do |e|
|
140
140
|
@engines[e] = ESearchy::Search::EMAIL_ENGINES[e].new(Search.query)
|
141
141
|
end
|
142
142
|
self.maxhits=Search.maxhits if Search.maxhits
|
@@ -165,7 +165,7 @@ module ESearchy
|
|
165
165
|
|
166
166
|
def initialize(*args, &block)
|
167
167
|
@engines={}
|
168
|
-
args.each do |e|
|
168
|
+
(args[0].instance_of?(Array) ? args[0] : args).each do |e|
|
169
169
|
@engines[e] = ESearchy::Search::PEOPLE_ENGINES[e].new(Search.company)
|
170
170
|
end
|
171
171
|
self.maxhits=Search.maxhits if Search.maxhits
|
data/lib/esearchy.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esearchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
4
|
+
version: 0.2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias P. Brutti
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-15 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1.
|
33
|
+
version: 1.1.9
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: FreedomCoder-rubyzip
|
@@ -42,16 +42,6 @@ dependencies:
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 0.9.3
|
44
44
|
version:
|
45
|
-
- !ruby/object:Gem::Dependency
|
46
|
-
name: ruby-ldap
|
47
|
-
type: :runtime
|
48
|
-
version_requirement:
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: 0.9.9
|
54
|
-
version:
|
55
45
|
- !ruby/object:Gem::Dependency
|
56
46
|
name: spidr
|
57
47
|
type: :runtime
|