asian_character_image 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/asian_character_image.rb +22 -0
  3. metadata +43 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmFhYzYxY2EzMmU2YjNiMzg3Y2YwYjg0MTllMGQ5OTJiMjMxOTFlOA==
5
+ data.tar.gz: !binary |-
6
+ Njk3NTQxMWFkZWVlMzA0MzgyOTkzOGE5Yjk0YWZjMjdlNDE0OWRjMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NWY3MzAxMzQzNGVmMjdjYTQxYjAxYzM1NzljYTJlNGU5NjY3OTI0N2ZmMjli
10
+ Yjc0MGNkMTc1N2M5YTEyNTU4MzE0NDAyMGExNzFhNzNkNmYyZjlmOTE0OWZk
11
+ MjE4NDc3Mzk1YmJkZGYwZjJkYjM0MGM0YjllMGFlYmY3ZGM5ZDI=
12
+ data.tar.gz: !binary |-
13
+ OTE0ZWI1ZWM1ZGNhNjZlMDc5N2M5MjdhYjdmMjI0ODA5NTI2MWE2MmFiODU1
14
+ ZTgxOTlmMGVhOTEyYTQ0OTFiYTVhZWNiZTIxNzY1YjY3ODMzODMwZmE2YTMx
15
+ ZDAwNzBiYzFlODNkNThlMWQyN2QxMGVjZWVkMWQ2ZjQwNmVkYTA=
@@ -0,0 +1,22 @@
1
+ require 'rest_client'
2
+
3
+ module AsianCharacterImage
4
+ class Word
5
+ def initialize(word_unicode,fsize)
6
+ @word_unicode = word_unicode
7
+ @fsize = fsize
8
+ end
9
+
10
+ def image_url
11
+ url = 'http://chinese.biodinfo.org/'\
12
+ 'ChineseCharactorWebService.asmx/'\
13
+ 'GetCharactorImageUrl?code=' +
14
+ URI.escape(@word_unicode) + '&fsize=' + URI.escape(@fsize)+ '&psd=1'
15
+ res = RestClient.get(url)
16
+ #res.gsub!(/\s/, ' ')
17
+ res=res.match(%r|<string.*>\s*(.+)\s*</string>|)
18
+ puts "ddd"
19
+ @image_url = res ? res[1].strip : nil
20
+ end
21
+ end
22
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asian_character_image
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - DanielZhang
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/asian_character_image.rb
20
+ homepage:
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.1.11
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: awesome_gem is the best
43
+ test_files: []