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 +4 -4
- data/lib/ihuyi/sms.rb +9 -7
- data/lib/ihuyi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1519852789747c8a5409e4547e9c0b91d8f2536b
|
4
|
+
data.tar.gz: 0278daf0de9ede3563d1ce82e1d215aef075df0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b657030e71edee33c319d05924c5ce100c1a4c39d62f4057302178c9a827e1c0d5d98a4d126315e545c092a84db8ca3a0a9b3ddce76cfac59fb33fbe75cba968
|
7
|
+
data.tar.gz: 2fe9b510a8e484213a3ca8efe7a2b2887f1c01b005598b107ec748d997f39eb9fca203e235a4458ef3786c4447830349b6023c21c4d3964f00bff2fa563208dd
|
data/lib/ihuyi/sms.rb
CHANGED
@@ -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(
|
15
|
-
|
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
|
data/lib/ihuyi/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|