yunpiansms 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/lib/yunpiansms/sms_resources.rb +1 -1
- data/lib/yunpiansms/version.rb +1 -1
- data/lib/yunpiansms.rb +4 -0
- data/test.rb +3 -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: 0ce4c5c3e182704883685e452ffaee69c213e75d
|
4
|
+
data.tar.gz: f7c0f333743e089a2c54467adb1040a33cc368a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5865438b91cbd21f702554eff3bcdc2bd23b9c510acd5e7e5c34b097a28e1b98b966c77e6f862c12bd2984fe6c2476a3f0acfb6340718e89d301393e6e243181
|
7
|
+
data.tar.gz: b1e625c37de59dc860e1265049e034c09b059a67b7775ecfdafb66c02530a3c054b7642a1eb6748018d7b0e4873012b7f8cc5ce5b1db2d9f175e112fcd602370
|
data/README.md
CHANGED
@@ -21,9 +21,39 @@ Or install it yourself as:
|
|
21
21
|
$ gem install yunpiansms
|
22
22
|
|
23
23
|
## Usage
|
24
|
+
The main method
|
25
|
+
```ruby
|
26
|
+
def send_to(content, mobiles = nil)
|
27
|
+
http.post(Yunpiansms::SmsResources::SEND_URL,params_data(content, mobiles))
|
28
|
+
end
|
29
|
+
|
30
|
+
def tpl_send_to(content, mobiles = nil, tpl_id = nil, tpl_value=nil)
|
31
|
+
http.post(Yunpiansms::SmsResources::TPL_SEND_URL,params_data_tpl(content, mobiles, tpl_id,tpl_value))
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_record(options={})
|
35
|
+
http.get(Yunpiansms::SmsResources::GET_URL,format_content(options))
|
36
|
+
end
|
37
|
+
```
|
38
|
+
Usage
|
39
|
+
```ruby
|
40
|
+
@yunpiansms_service = Yunpiansms::Service.config do |s|
|
41
|
+
s.apikey = "" # apikey
|
42
|
+
s.connection_adapter = :net_http # default
|
43
|
+
end
|
44
|
+
|
45
|
+
content = {mobile: "1367777777,1367777777",text: "123",uid: "15279"}
|
46
|
+
result = @yunpiansms_service.send_to(content)
|
24
47
|
|
25
|
-
|
48
|
+
content = {text: "123",uid: "15279"}
|
49
|
+
result = @yunpiansms_service.send_to(content,["1367777777","1367777777"])
|
50
|
+
result = @yunpiansms_service.send_to(content,"1367777777,1367777777")
|
26
51
|
|
52
|
+
content = {mobile: "1367777777,1367777777",tpl_value: {key:"1245",key1:"23"},uid: "15279",tpl_id:1}
|
53
|
+
result = @yunpiansms_service.tpl_send_to(content)
|
54
|
+
|
55
|
+
result = @yunpiansms_service.get_record({start_time: Time.now,end_time:Time.now,page_num:1,page_size:100,mobile:"15279058466"})
|
56
|
+
```
|
27
57
|
## Development
|
28
58
|
|
29
59
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/yunpiansms/version.rb
CHANGED
data/lib/yunpiansms.rb
CHANGED
@@ -25,6 +25,10 @@ module Yunpiansms
|
|
25
25
|
http.post(Yunpiansms::SmsResources::TPL_SEND_URL,params_data_tpl(content, mobiles, tpl_id,tpl_value))
|
26
26
|
end
|
27
27
|
|
28
|
+
def get_record(options={})
|
29
|
+
http.get(Yunpiansms::SmsResources::GET_URL,format_content(options))
|
30
|
+
end
|
31
|
+
|
28
32
|
private
|
29
33
|
|
30
34
|
def params_data(content, mobiles)
|
data/test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yunpiansms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- trycatch
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|