luosimao 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/luosimao/message.rb +4 -3
- data/lib/luosimao/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 489634a344de7a88d47c6fa4f59e455ddf14996c
|
|
4
|
+
data.tar.gz: ab046b101dcef02b80bd0faf715978b6fc3fe98c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67e078e2e610a4bbe5c9a2fb5cf63aefb2fb618530712c3cd366e80977aeb728efa7e86e55739c7622f1ef79c8cac7e2974533eb11a81c3d93c242a957a4e7b0
|
|
7
|
+
data.tar.gz: 4b6d8d8dd94cc89ba2d4e0fc4d7609ac6a6c45a525fc305e361e90968e4d3fe2c3bec1666a90f4c3153c590ae11ff7372eb8d2fb58bd5d11166172881e4f8f5c
|
data/README.md
CHANGED
|
@@ -19,9 +19,16 @@ Or install it yourself as:
|
|
|
19
19
|
$ gem install luosimao
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
### Config
|
|
23
|
+
```ruby
|
|
24
|
+
Luosimao.username = "danche"
|
|
25
|
+
Luosimao.key = "dianying"
|
|
26
|
+
Luosimao.brand = "【单车电影】"
|
|
27
|
+
```
|
|
28
|
+
### Send message
|
|
29
|
+
```ruby
|
|
30
|
+
Luosimao::Message.to "10086", "hello world!"
|
|
31
|
+
```
|
|
25
32
|
## Contributing
|
|
26
33
|
|
|
27
34
|
1. Fork it ( https://github.com/[my-github-username]/luosimao/fork )
|
data/lib/luosimao/message.rb
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
|
+
require 'json'
|
|
2
3
|
module Luosimao
|
|
3
4
|
module Message
|
|
4
|
-
|
|
5
|
+
SEND_URL = "https://sms-api.luosimao.com/v1/send.json"
|
|
5
6
|
|
|
6
|
-
def
|
|
7
|
-
url =
|
|
7
|
+
def self.to(phone, content)
|
|
8
|
+
url = URI.parse SEND_URL
|
|
8
9
|
post = Net::HTTP::Post.new(url.path)
|
|
9
10
|
post.basic_auth(Luosimao.username, Luosimao.key)
|
|
10
11
|
post.set_form_data({mobile: phone, message: "#{content}#{Luosimao.brand}"})
|
data/lib/luosimao/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: luosimao
|
|
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
|
- Villins
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
74
74
|
version: '0'
|
|
75
75
|
requirements: []
|
|
76
76
|
rubyforge_project:
|
|
77
|
-
rubygems_version: 2.
|
|
77
|
+
rubygems_version: 2.2.2
|
|
78
78
|
signing_key:
|
|
79
79
|
specification_version: 4
|
|
80
80
|
summary: a warpper of luosimao send message
|