baidu 1.1.5 → 1.1.6
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.
- checksums.yaml +4 -4
- data/lib/baidu.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52b9cd5797526c064fbc02c78c64e1065fa0c8aa
|
|
4
|
+
data.tar.gz: bc4ad98a35ed10d2a37f0d152257807a292f2f1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e073bc2876edaf4f7fc5abe13f986cb8d5b49ae31c797d21e246230cd004470c8a51accea5d63d9b97502f6e9e0d4b94d4c8f326f90e20885a743aa39fe70dd3
|
|
7
|
+
data.tar.gz: ba35086716501e36a2b026e65a2632daab8db3ed0301fd36b3f72796edc838032f611842d0350e972999c364f0d9426c83771b45bce43a100764814a1e4040e7
|
data/lib/baidu.rb
CHANGED
|
@@ -216,9 +216,9 @@ class Baidu < SearchEngine
|
|
|
216
216
|
PerPage = 100
|
|
217
217
|
|
|
218
218
|
def initialize
|
|
219
|
-
@a = Mechanize.new {|agent| agent.user_agent_alias = 'Linux Mozilla'}
|
|
220
|
-
@a.idle_timeout = 2
|
|
221
|
-
@a.max_history = 1
|
|
219
|
+
# @a = Mechanize.new {|agent| agent.user_agent_alias = 'Linux Mozilla'}
|
|
220
|
+
# @a.idle_timeout = 2
|
|
221
|
+
# @a.max_history = 1
|
|
222
222
|
@page = nil
|
|
223
223
|
end
|
|
224
224
|
|
|
@@ -253,7 +253,7 @@ class Baidu < SearchEngine
|
|
|
253
253
|
=end
|
|
254
254
|
|
|
255
255
|
def popular?(wd)
|
|
256
|
-
return
|
|
256
|
+
return HTTParty.get("http://index.baidu.com/main/word.php?word=#{URI.encode(wd.encode("GBK"))}").body.include?"boxFlash"
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
def query(wd)
|