sendsms 0.0.6 → 0.0.7
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/sendsms.rb +7 -6
- metadata +11 -4
data/lib/sendsms.rb
CHANGED
@@ -32,7 +32,7 @@ class SendSms
|
|
32
32
|
|
33
33
|
# The way2sms root url
|
34
34
|
URL = 'http://site6.way2sms.com'
|
35
|
-
|
35
|
+
|
36
36
|
#
|
37
37
|
# Initiate Sendsms class with way2sms username and password
|
38
38
|
#
|
@@ -137,7 +137,7 @@ class SendSms
|
|
137
137
|
# To send Group SMS
|
138
138
|
#
|
139
139
|
# @deprecated Use {#send} instead of this method
|
140
|
-
#
|
140
|
+
#
|
141
141
|
#
|
142
142
|
# @param [String] msisdns
|
143
143
|
# A semicolon seperated string of msisdns
|
@@ -156,6 +156,7 @@ class SendSms
|
|
156
156
|
#
|
157
157
|
#
|
158
158
|
def send_to_many msisdns, message
|
159
|
+
@auto_logout = false
|
159
160
|
if @cookie.nil?
|
160
161
|
login_res = login
|
161
162
|
return {:success => false,:message => "Login failed"} if !login_res[:success]
|
@@ -219,7 +220,7 @@ class SendSms
|
|
219
220
|
#
|
220
221
|
def set_header(cookie=nil,referer=nil)
|
221
222
|
{"Cookie" => cookie , "Referer" => referer ,"Content-Type" => "application/x-www-form-urlencoded",
|
222
|
-
"User-Agent" => "Mozilla/5.0 (
|
223
|
+
"User-Agent" => '"Mozilla/5.0 (Windows NT 6.1; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"' }
|
223
224
|
end
|
224
225
|
|
225
226
|
#
|
@@ -264,11 +265,11 @@ class SendSms
|
|
264
265
|
headers = set_header @cookie, @referer
|
265
266
|
data = "MobNo=#{msisdn}&textArea=#{message}&HiddenAction=instantsms&login=&pass=&Action=abfghst5654g"
|
266
267
|
response = @http.post("/quicksms.action?custid=\"+custid+\"&sponserid=\"+sponserid+\"",data,headers.delete_if {|i,j| j.nil? })
|
267
|
-
case response
|
268
|
-
when
|
268
|
+
case response["location"]
|
269
|
+
when /\bsuccessfully\b/
|
269
270
|
{:success => true,:message => "Send successfully"}
|
270
271
|
else
|
271
272
|
{:success => false,:message => "Sending failed"}
|
272
273
|
end
|
273
274
|
end
|
274
|
-
end
|
275
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sendsms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-04 00:00:00.
|
12
|
+
date: 2012-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hpricot
|
16
|
-
requirement: &
|
16
|
+
requirement: &71486850 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *71486850
|
25
25
|
description: The library Helps you to send SMS via way2sms in India
|
26
26
|
email:
|
27
27
|
- rsk@revathskumar.com
|
@@ -42,12 +42,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- - ! '>='
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
hash: 312694739
|
45
48
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
49
|
none: false
|
47
50
|
requirements:
|
48
51
|
- - ! '>='
|
49
52
|
- !ruby/object:Gem::Version
|
50
53
|
version: '0'
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
hash: 312694739
|
51
57
|
requirements: []
|
52
58
|
rubyforge_project:
|
53
59
|
rubygems_version: 1.8.10
|
@@ -55,3 +61,4 @@ signing_key:
|
|
55
61
|
specification_version: 3
|
56
62
|
summary: Send SMS via way2sms
|
57
63
|
test_files: []
|
64
|
+
has_rdoc:
|