FreedomCoder-esearchy 0.0.13 → 0.0.14
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.
- data/lib/esearchy.rb +1 -1
- data/lib/esearchy/bing.rb +1 -1
- data/lib/esearchy/google.rb +2 -2
- data/lib/esearchy/searchy.rb +8 -4
- data/lib/esearchy/yahoo.rb +1 -1
- metadata +1 -1
data/lib/esearchy.rb
CHANGED
data/lib/esearchy/bing.rb
CHANGED
data/lib/esearchy/google.rb
CHANGED
@@ -63,7 +63,7 @@ class Google
|
|
63
63
|
case result[1]
|
64
64
|
when /.doc$/i
|
65
65
|
@r_docs << result[1]
|
66
|
-
when /.docx$|.xlsx$|.pptx$/i
|
66
|
+
when /.docx$|.xlsx$|.pptx$|.odt$|.odp$|.ods$|.odb$/i
|
67
67
|
@r_officexs << result[1]
|
68
68
|
end
|
69
69
|
when nil
|
@@ -72,7 +72,7 @@ class Google
|
|
72
72
|
@r_pdfs << result[2]
|
73
73
|
when /.doc$/i
|
74
74
|
@r_docs << result[2]
|
75
|
-
when /.docx$|.xlsx$|.pptx$/i
|
75
|
+
when /.docx$|.xlsx$|.pptx$|.odt$|.odp$|.ods$|.odb$/i
|
76
76
|
@r_officexs << result[2]
|
77
77
|
when /.txt$|.rtf$|ans$/i
|
78
78
|
@r_txts << result[2]
|
data/lib/esearchy/searchy.rb
CHANGED
@@ -102,10 +102,11 @@ module Searchy
|
|
102
102
|
word.activedocument.close( false )
|
103
103
|
word.quit
|
104
104
|
rescue
|
105
|
-
if File.exists?("C:\\
|
106
|
-
search_emails(`antiword "#{name}" -f -s`)
|
105
|
+
if File.exists?("C:\\antiword\\antiword.exe")
|
106
|
+
search_emails(`C:\\antiword\\antiword.exe "#{name}" -f -s`)
|
107
107
|
else
|
108
|
-
ESearchy::LOG.puts "
|
108
|
+
ESearchy::LOG.puts "You need to install either Microsoft Word or Antiword
|
109
|
+
to parse .docs"
|
109
110
|
end
|
110
111
|
end
|
111
112
|
elsif RUBY_PLATFORM =~ /linux|darwin/
|
@@ -114,6 +115,8 @@ module Searchy
|
|
114
115
|
File.exists?("/usr/local/bin/antiword") or
|
115
116
|
File.exists?("/opt/local/bin/antiword")
|
116
117
|
search_emails(`antiword "#{name}" -f -s`)
|
118
|
+
else
|
119
|
+
ESearchy::LOG.puts "You need to install Antiword to parse .docs"
|
117
120
|
end
|
118
121
|
rescue
|
119
122
|
ESearchy::LOG.puts "Something went wrong parsing the .doc\n"
|
@@ -142,7 +145,8 @@ module Searchy
|
|
142
145
|
while urls.size >= 1
|
143
146
|
@threads << Thread.new do
|
144
147
|
web = URI.parse(urls.pop)
|
145
|
-
format = web.scan(/docx|xlsx|pptx/i)[0]
|
148
|
+
#format = web.scan(/docx|xlsx|pptx/i)[0]
|
149
|
+
format = web.scan(/docx|xlsx|pptx|odt|odp|ods|odb/i)[0]
|
146
150
|
ESearchy::LOG.puts "Searching in #{format.upcase}: #{web.to_s}\n"
|
147
151
|
begin
|
148
152
|
http = Net::HTTP.new(web.host,80)
|
data/lib/esearchy/yahoo.rb
CHANGED