msg91 0.1.0 → 0.2.1
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 +7 -0
- data/lib/generators/msg91/install_generator.rb +1 -1
- data/lib/msg91.rb +1 -15
- data/lib/msg91/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: 6f45f40a23dfa661ccecc56d74ac560fb24b2f3b
|
4
|
+
data.tar.gz: b7a67aaf25173ea69796c46b0b376530a39264c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57243f44b45139fcbf4bb831593fa97068b86c5fc057576a52ebe8c5a9fe3a828b5a40df39ba7f8cec49db415435effc1b992773703b071da8e27f7dff71d66
|
7
|
+
data.tar.gz: 812935e08634ba22ad6e7b71508921c2b731a6811f8d3189cc95b28c12164bb1384eea20a043349030486e70abed67f88ba758d176968b68459559010392535b
|
data/README.md
CHANGED
@@ -36,6 +36,13 @@ To send a message
|
|
36
36
|
```ruby
|
37
37
|
message = Msg91::Message.send_text(sender_id,route,text,recepients,country)
|
38
38
|
```
|
39
|
+
| params | type | description |
|
40
|
+
|------------|------------------|----------------------------------------------------------------------|
|
41
|
+
| sender_id | string | It contains sender ID |
|
42
|
+
| route | string | Route name if you have more than one route available in your account |
|
43
|
+
| text | string | It contains the URL encoded message content to send |
|
44
|
+
| recepients | array of strings | It contain mobile numbers without country code |
|
45
|
+
| country | string | 0 for international, 91 for India, 1 for USA |
|
39
46
|
|
40
47
|
## Development
|
41
48
|
|
data/lib/msg91.rb
CHANGED
@@ -3,7 +3,7 @@ require "msg91/configuration"
|
|
3
3
|
require "msg91/message"
|
4
4
|
require 'uri'
|
5
5
|
require 'net/http'
|
6
|
-
require '
|
6
|
+
require 'json'
|
7
7
|
|
8
8
|
module Msg91
|
9
9
|
|
@@ -19,18 +19,4 @@ module Msg91
|
|
19
19
|
yield(configuration)
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.send_text(text,recepients,sender_id='ORANGE',route='4',country='91')
|
23
|
-
auth_key = Msg91.configuration.auth_key
|
24
|
-
puts Msg91.configuration
|
25
|
-
http = Net::HTTP.new('http://api.msg91.com',80)
|
26
|
-
path = '/api/v2/sendsms'
|
27
|
-
url = URI("http://api.msg91.com/api/v2/sendsms")
|
28
|
-
http = Net::HTTP.new(url.host, url.port)
|
29
|
-
request = Net::HTTP::Post.new(url)
|
30
|
-
headers = Hash.new
|
31
|
-
headers = {'authkey' => auth_key,'Content-Type' => 'application/json','unicode' => '1'}
|
32
|
-
body_string = self.build_hash(sender_id,route,text,recepients,country)
|
33
|
-
response = http.post(path,body_string,headers)
|
34
|
-
puts response.read_body
|
35
|
-
end
|
36
22
|
end
|
data/lib/msg91/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: msg91
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- digiryte
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|