messenger 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/messenger/campfire.rb +3 -2
- data/lib/messenger/notifo.rb +3 -2
- data/lib/messenger/version.rb +1 -1
- metadata +2 -2
data/lib/messenger/campfire.rb
CHANGED
@@ -16,9 +16,10 @@ class Messenger::Campfire
|
|
16
16
|
ssl, api_key, room, subdomain = matcher(url)
|
17
17
|
options[:headers] ||= {}
|
18
18
|
response = HTTParty.post(
|
19
|
-
"http#{ssl ? "s" : ""}://#{
|
19
|
+
"http#{ssl ? "s" : ""}://#{subdomain}.campfirenow.com/room/#{room}/speak.json",
|
20
20
|
:headers => { "Content-Type" => "application/json"}.merge(options[:headers]),
|
21
|
-
:body => { "message" => { "body" => body } }.to_json
|
21
|
+
:body => { "message" => { "body" => body } }.to_json,
|
22
|
+
:basic_auth => {:username => api_key, :password => 'x'}
|
22
23
|
)
|
23
24
|
Messenger::Result.new(success?(response), response)
|
24
25
|
end
|
data/lib/messenger/notifo.rb
CHANGED
@@ -18,8 +18,9 @@ class Messenger::Notifo
|
|
18
18
|
def self.deliver(url, message, options={})
|
19
19
|
raise Messenger::URLError, "The URL provided is invalid" unless valid_url?(url)
|
20
20
|
username = matcher(url)
|
21
|
-
response = HTTParty.post("https
|
22
|
-
:body => { :to => username, :msg => message, :title => options[:notifo_title], :uri => options[:notifo_url] }
|
21
|
+
response = HTTParty.post("https://api.notifo.com/v1/send_notification",
|
22
|
+
:body => { :to => username, :msg => message, :title => options[:notifo_title], :uri => options[:notifo_url] },
|
23
|
+
:basic_auth => {:username => options[:notifo_api_username], :password => options[:notifo_api_secret]})
|
23
24
|
Messenger::Result.new(success?(response), response)
|
24
25
|
end
|
25
26
|
|
data/lib/messenger/version.rb
CHANGED