ihuyi 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e97b84c4d7fd4e6ccbdcba19986fb1215dd8944
4
- data.tar.gz: f3c53bbbbe5c471de7c8037f0da2ae2bc424266f
3
+ metadata.gz: 1519852789747c8a5409e4547e9c0b91d8f2536b
4
+ data.tar.gz: 0278daf0de9ede3563d1ce82e1d215aef075df0d
5
5
  SHA512:
6
- metadata.gz: 6c69f6ba2d38cbd27e77d2f86d4af1a1e9d0059ed4bf4dd5738f742a01ee0ba7064678fa1562439b812dd98ba7b2a65cd48f3c05528ee4c24c9f3924ed222d7a
7
- data.tar.gz: 8eb736fd191d13bd6696a3ff985e5fd09d63d7c15d5d157ee6d1064614d1dc77e6f963ae3b369ed4c4e118173cdca033dd9e16d995f3a5e0b8811e7ebc406ca4
6
+ metadata.gz: b657030e71edee33c319d05924c5ce100c1a4c39d62f4057302178c9a827e1c0d5d98a4d126315e545c092a84db8ca3a0a9b3ddce76cfac59fb33fbe75cba968
7
+ data.tar.gz: 2fe9b510a8e484213a3ca8efe7a2b2887f1c01b005598b107ec748d997f39eb9fca203e235a4458ef3786c4447830349b6023c21c4d3964f00bff2fa563208dd
@@ -3,16 +3,18 @@ require 'nori'
3
3
 
4
4
  module Ihuyi
5
5
  module SMS
6
+ # return send_status(true/false), send_msg (xxxxxx[send_code])
6
7
  def self.deliver(cellphone, content)
7
-
8
8
  base_uri = "http://106.ihuyi.cn/webservice/sms.php"
9
-
10
- sms_url = "#{base_uri}?method=Submit&account=#{Ihuyi.account}&password=#{Ihuyi.password}&mobile=#{cellphone}&content=#{content}"
11
-
12
-
13
9
  parser = Nori.new(:parser => :rexml)
14
- res = parser.parse(RestClient.get(sms_url))
15
- return res['SubmitResult']['code'], res['SubmitResult']['msg']
10
+ res = parser.parse(RestClient.get(base_uri, { :params => {
11
+ :method => 'Submit',
12
+ :account => Ihuyi.account,
13
+ :password => Ihuyi.password,
14
+ :mobile => cellphone,
15
+ :content => content
16
+ } }))
17
+ return res['SubmitResult']['code'] == '2', "#{res['SubmitResult']['msg']}[#{res['SubmitResult']['code']}]"
16
18
  end
17
19
  end
18
20
  end
@@ -1,3 +1,3 @@
1
1
  module Ihuyi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ihuyi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - debbbbie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-08 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler