iciba 0.0.15 → 0.0.16

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.
@@ -5,8 +5,6 @@ module Iciba
5
5
  class Fanyi
6
6
  attr_accessor :response, :html, :dir, :result
7
7
 
8
-
9
-
10
8
  def initialize(words, dir='auto', logs=false, extended=false, pinyin=false)
11
9
  puts '------------------------------------------------------------------------------------' if logs
12
10
  # puts if bingit
@@ -47,7 +45,7 @@ module Iciba
47
45
  def download_and_parse(words, dir, extended)
48
46
  self.response = Iciba::Tools.parse(Iciba::Tools.post('http://fy.iciba.com/api.php', {:q => words, :type => dir}).body_str)
49
47
  self.html = self.response.ret.encode("UTF-8")
50
- self.result = (Iciba::Tools.doc(self.html)/'span.dd').text.strip
48
+ self.result = (Iciba::Tools.doc(self.html)/'div.translate_result').text.strip
51
49
  self.result = self.html if self.result == ""
52
50
  self.result = self.result.split(',')[0] if self.result.include?(',') unless extended
53
51
  self.result = self.result.split(';')[0] if self.result.include?(';') unless extended
@@ -1,3 +1,3 @@
1
1
  module Iciba
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iciba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-10 00:00:00.000000000 Z
12
+ date: 2012-09-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb