esearchy 0.2.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,6 +55,7 @@ opts = GetoptLong.new(
55
55
  [ '--enable-altavisa', GetoptLong::NO_ARGUMENT ],
56
56
  [ '--enable-linkedin', GetoptLong::NO_ARGUMENT ],
57
57
  [ '--enable-gprofiles', GetoptLong::NO_ARGUMENT ],
58
+ [ '--enable-gplus', GetoptLong::NO_ARGUMENT ],
58
59
  [ '--enable-naymz', GetoptLong::NO_ARGUMENT ],
59
60
  [ '--enable-ggroups', GetoptLong::NO_ARGUMENT ],
60
61
  [ '--enable-spoke', GetoptLong::NO_ARGUMENT ],
@@ -71,6 +72,7 @@ opts = GetoptLong.new(
71
72
  [ '--disable-altavisa', GetoptLong::NO_ARGUMENT ],
72
73
  [ '--disable-linkedin', GetoptLong::NO_ARGUMENT ],
73
74
  [ '--disable-gprofiles', GetoptLong::NO_ARGUMENT ],
75
+ [ '--disable-gplus', GetoptLong::NO_ARGUMENT ],
74
76
  [ '--disable-naymz', GetoptLong::NO_ARGUMENT ],
75
77
  [ '--disable-ggroups', GetoptLong::NO_ARGUMENT ],
76
78
  [ '--disable-spoke', GetoptLong::NO_ARGUMENT ],
@@ -328,6 +330,8 @@ opts.each do |opt, arg|
328
330
  puts "\t Enables LinkedIn searches.\n"
329
331
  puts "--enable-gprogiles"
330
332
  puts "\t Enables Google Profiles searches.\n"
333
+ puts "--enable-gplus"
334
+ puts "\t Enables Google Plus searches.\n"
331
335
  puts "--enable-naymz"
332
336
  puts "\t Enables Naymz searches.\n"
333
337
  puts "--enable-spoke"
@@ -358,6 +362,8 @@ opts.each do |opt, arg|
358
362
  puts "\t Disables LinkedIn searches.\n"
359
363
  puts "--disable-gprogiles"
360
364
  puts "\t Disables Google Profiles searches.\n"
365
+ puts "--disable-gplus"
366
+ puts "\t Disables Google Plus searches.\n"
361
367
  puts "--disable-naymz"
362
368
  puts "\t Disables Naymz searches.\n"
363
369
  puts "--disable-spoke"
@@ -380,11 +386,11 @@ opts.each do |opt, arg|
380
386
  #END OF HELP
381
387
  exit(0)
382
388
  when '--enable-all' then
383
- @people_engines = [:LinkedIn, :Naymz, :Classmates, :GoogleProfiles,
384
- :Spoke, :JigSaw, :Ziggs, :Plaxo]
389
+ @people_engines = [:LinkedIn, :Naymz, :Classmates, :GoogleProfiles, :GooglePlus,
390
+ :Spoke, :JigSaw, :Ziggs, :Plaxo]
385
391
  @email_engines = [:Google, :Bing, :Yahoo, :Altavista, :PGP, :Spider ,:Usenet, :GoogleGroups ]
386
392
  when '--enable-people' then
387
- @people_engines = [:LinkedIn, :Naymz, :Classmates, :GoogleProfiles,
393
+ @people_engines = [:LinkedIn, :Naymz, :Classmates, :GoogleProfiles, :GooglePlus,
388
394
  :Spoke, :JigSaw, :Ziggs, :Plaxo]
389
395
  when '--enable-emails' then
390
396
  @email_engines = [:Google, :Bing, :Yahoo, :Altavista, :PGP, :Spider ,:Usenet, :GoogleGroups ]
@@ -402,6 +408,8 @@ opts.each do |opt, arg|
402
408
  @people_engines << :LinkedIn
403
409
  when '--enable-gprofiles' then
404
410
  @people_engines << :GoogleProfiles
411
+ when '--enable-gplus' then
412
+ @people_engines << :GooglePlus
405
413
  when '--enable-naymz' then
406
414
  @people_engines << :Naymz
407
415
  when '--enable-classmates' then
@@ -438,6 +446,8 @@ opts.each do |opt, arg|
438
446
  @people_engines.delete(:LinkedIn)
439
447
  when '--disable-gprofiles' then
440
448
  @people_engines.delete(:GoogleProfiles)
449
+ when '--disable-gplus' then
450
+ @people_engines.delete(:GooglePlus)
441
451
  when '--disable-naymz' then
442
452
  @people_engines.delete(:Naymz)
443
453
  when '--disable-classmates' then
@@ -22,7 +22,7 @@ module ESearchy
22
22
  end
23
23
 
24
24
  def crawl_people(html)
25
- html.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*) \|/).each do |profile|
25
+ html.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) \|/).each do |profile|
26
26
  pf = profile[0].to_s
27
27
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
28
28
  p = profile[1].split(" ")
@@ -0,0 +1,38 @@
1
+ module ESearchy
2
+ module SocialEngines
3
+ class GooglePlus < ESearchy::GenericEngine
4
+ ENGINE = "www.google.com"
5
+ PORT = 80
6
+ NUM = 100
7
+ TYPE = 2
8
+
9
+ def search
10
+ @querypath = "/cse?q=site:https://plus.google.com+intitle:%22Google+" +
11
+ "Profile%22+%22Companies+I%27ve+worked+for%22+%22at+" +
12
+ CGI.escape(@company) + "%22&hl=en&cof=&num=100&filter=0&safe=off&start=" or
13
+ raise ESearchyMissingCompany, "Mssing website url Object.company=(value)"
14
+ super
15
+ end
16
+
17
+ def parse( html )
18
+ #Results <b>1</b> - <b>8</b> of <b>8</b> from <b>www.google.com</b>
19
+ hits = html.scan(/<\/b> of <b>(.*)<\/b> from /)
20
+ if hits.empty? or hits == nil
21
+ @totalhits = 0
22
+ else
23
+ @totalhits = totalhits(hits[0][0].gsub(",","").to_i) unless @was_here
24
+ end
25
+ end
26
+
27
+ def crawl_people(text)
28
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) -/).each do |profile|
29
+ pf = profile[0].to_s
30
+ pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+) - Google+/).to_s if pf.match(/\/url\?q=/)
31
+ p = profile[1].split(" ")
32
+ @people << [ p, pf ]
33
+ @results << [p, "P",profile, self.class.to_s.upcase, "N"]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -25,7 +25,7 @@ module ESearchy
25
25
  end
26
26
 
27
27
  def crawl_people(text)
28
- text.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*) -/).each do |profile|
28
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) -/).each do |profile|
29
29
  pf = profile[0].to_s
30
30
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
31
31
  p = profile[1].split(" ")
@@ -25,7 +25,7 @@ module ESearchy
25
25
  end
26
26
 
27
27
  def crawl_people(text)
28
- text.scan(/<a href="(http\:\/\/www.jigsaw.com\/scid[0-9A-Za-z\/?&=@+%.;'_-]+\.xhtml)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*),/).each do |profile|
28
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*),/).each do |profile|
29
29
  pf = profile[0].to_s
30
30
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
31
31
  p = profile[1].split(" ")
@@ -24,7 +24,7 @@ module ESearchy
24
24
  end
25
25
 
26
26
  def crawl_people(text)
27
- text.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*) \|/).each do |profile|
27
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) \|/).each do |profile|
28
28
  pf = profile[0].to_s
29
29
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
30
30
  p = profile[1].split(" ")
@@ -23,7 +23,7 @@ module ESearchy
23
23
  end
24
24
 
25
25
  def crawl_people(html)
26
- html.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*) -/).each do |profile|
26
+ html.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) -/).each do |profile|
27
27
  pf = profile[0].to_s
28
28
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
29
29
  p = profile[1].split(" ").delete_if do
@@ -25,7 +25,7 @@ module ESearchy
25
25
  end
26
26
 
27
27
  def crawl_people(text)
28
- text.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*)&#39;/).each do |profile|
28
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*)&#39;/).each do |profile|
29
29
  pf = profile[0].to_s
30
30
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
31
31
  p = profile[1].split(" ")
@@ -24,7 +24,7 @@ module ESearchy
24
24
  end
25
25
 
26
26
  def crawl_people(text)
27
- text.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*),/).each do |profile|
27
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*),/).each do |profile|
28
28
  pf = profile[0].to_s
29
29
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
30
30
  p = profile[1].split(" ")
@@ -25,7 +25,7 @@ module ESearchy
25
25
  end
26
26
 
27
27
  def crawl_people(text)
28
- text.scan(/<a href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" class=l[\sonmousedown="return clk(this.href,'','','res','\d','')"]*>([\w\s]*) -/).each do |profile|
28
+ text.scan(/<a class="l" href="([0-9A-Za-z:\\\/?&=@+%.;"'()_-]+)" [\sonmousedown="return curwt(this, ']*[0-9A-Za-z:\\\/?&=@+%.;"'()_-]*[')"]*>([\w\s]*) -/).each do |profile|
29
29
  pf = profile[0].to_s
30
30
  pf = pf.scan(/\/url\?q=([0-9A-Za-z:\\\/?=@+%.;"'()_-]+)&amp/).to_s if pf.match(/\/url\?q=/)
31
31
  p = profile[1].split(" ")
@@ -35,7 +35,8 @@ module ESearchy
35
35
 
36
36
  PEOPLE_ENGINES = {
37
37
  :LinkedIn => ESearchy::SocialEngines::LinkedIn,
38
- :GoogleProfiles => ESearchy::SocialEngines::GoogleProfiles,
38
+ :GoogleProfiles => ESearchy::SocialEngines::GoogleProfiles,
39
+ :GooglePlus => ESearchy::SocialEngines::GooglePlus,
39
40
  :Naymz => ESearchy::SocialEngines::Naymz,
40
41
  :Classmates => ESearchy::SocialEngines::Classmates,
41
42
  :Spoke => ESearchy::SocialEngines::Spoke,
@@ -23,6 +23,8 @@ module ESearchy
23
23
  else
24
24
  response.error!
25
25
  end
26
+ rescue Timeout::Error
27
+ return nil
26
28
  rescue
27
29
  return nil
28
30
  end
@@ -1,5 +1,6 @@
1
1
  require 'esearchy/SocialEngines/classmates'
2
2
  require 'esearchy/SocialEngines/googleprofiles'
3
+ require 'esearchy/SocialEngines/googleplus'
3
4
  require 'esearchy/SocialEngines/linkedin'
4
5
  require 'esearchy/SocialEngines/naymz'
5
6
  require 'esearchy/SocialEngines/spoke'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esearchy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 85
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- - 1
11
- version: 0.2.2.1
9
+ - 3
10
+ version: 0.2.3
12
11
  platform: ruby
13
12
  authors:
14
13
  - Matias P. Brutti
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2011-04-07 00:00:00 Z
18
+ date: 2011-09-08 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: pdf-reader
@@ -128,6 +127,7 @@ files:
128
127
  - lib/esearchy/SearchEngines/yahoo.rb
129
128
  - lib/esearchy/searchengines.rb
130
129
  - lib/esearchy/SocialEngines/classmates.rb
130
+ - lib/esearchy/SocialEngines/googleplus.rb
131
131
  - lib/esearchy/SocialEngines/googleprofiles.rb
132
132
  - lib/esearchy/SocialEngines/jigsaw.rb
133
133
  - lib/esearchy/SocialEngines/linkedin.rb
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  requirements: []
170
170
 
171
171
  rubyforge_project:
172
- rubygems_version: 1.7.2
172
+ rubygems_version: 1.8.10
173
173
  signing_key:
174
174
  specification_version: 3
175
175
  summary: A library to search for emails in search engines