iciba 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/iciba/fanyi.rb +1 -3
- data/lib/iciba/version.rb +1 -1
- metadata +2 -2
data/lib/iciba/fanyi.rb
CHANGED
@@ -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)/'
|
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
|
data/lib/iciba/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2012-09-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: curb
|