smsify 1.0.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.
- data/lib/smsify.rb +33 -0
- metadata +47 -0
data/lib/smsify.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
class SMSify
|
5
|
+
@@endpoint="https://www.smsify.com.au/transport/"
|
6
|
+
def self.endpoint
|
7
|
+
@@endpoint
|
8
|
+
end
|
9
|
+
|
10
|
+
@@api_key=""
|
11
|
+
def self.api_key
|
12
|
+
@@api_key
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(key)
|
16
|
+
@@api_key=key
|
17
|
+
end
|
18
|
+
|
19
|
+
def sendSMS(message, mobile)
|
20
|
+
uri = URI.parse(@@endpoint)
|
21
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
22
|
+
http.use_ssl = true
|
23
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
24
|
+
|
25
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
26
|
+
request.set_form_data({'method' => 'sendSMS', 'key' => @@api_key, 'send_to' => mobile, 'message' => message})
|
27
|
+
|
28
|
+
response = http.request(request)
|
29
|
+
#puts response.body
|
30
|
+
#puts response.code
|
31
|
+
return response
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: smsify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Marko Tomic
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-07-13 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! 'SMSify gateway wrapper for Ruby. Get your API key from <a href=''http://www.smsify.com.au''>SMSify.com.au</a>
|
15
|
+
and send SMS with this easy to use gem.<br/> Usage: smsify = SMSify.new(''your_api_key'')<br/>response
|
16
|
+
= smsify.sendSMS(''Your SMS MESSAGE'', ''61xxxxxxxxx'')'
|
17
|
+
email: marko@markomedia.com.au
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- lib/smsify.rb
|
23
|
+
homepage: https://rubygems.org/gems/smsify
|
24
|
+
licenses: []
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 1.8.25
|
44
|
+
signing_key:
|
45
|
+
specification_version: 3
|
46
|
+
summary: SMSify!
|
47
|
+
test_files: []
|