baidu 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. data/lib/baidu.rb +2 -2
  2. metadata +1 -1
@@ -117,7 +117,7 @@ class BaiduResult
117
117
  @ranks[id]['href'] = a.first['href'].sub('http://www.baidu.com/link?url=','').strip
118
118
  unless url.nil?
119
119
  url = url.text.strip
120
- @ranks[id]['host'] = URI(URI.encode("http://#{url}")).host
120
+ @ranks[id]['host'] = Addressable::URI.parse(URI.encode("http://#{url}")).host
121
121
  else
122
122
  @ranks[id]['host'] = nil
123
123
  end
@@ -162,4 +162,4 @@ class BaiduResult
162
162
  def next
163
163
  @page = BaiduResult.new(Mechanize.new.click(@page.link_with(:text=>/下一页/))) unless @page.link_with(:text=>/下一页/).nil?
164
164
  end
165
- end
165
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baidu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: