roost 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +13 -13
- data/lib/roost.rb +12 -11
- data/lib/roost/version.rb +1 -1
- data/roost.gemspec +9 -9
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77377fdae341f44fe67ef2cfd7dbf48d6074b1fb
|
4
|
+
data.tar.gz: 0d774da3a5932e1dfea1aa1b183ef3c65f7a8cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16acce3631d7fac1a49e25713a14bfe2e9459a1c6598622273ebcb72e05d466d0e88183b3a57a98a1da406b3eacc8a23ebe8e46ba2e090748ab65d848669e866
|
7
|
+
data.tar.gz: b8bdfd4636e6e049ac53af2d511be2e32c535139148ca4fbc4db6b0754336f8e82698df6fda7ee8318052712d50583c5e9ea3839f93f34d70397c023226ad92a
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
# Roost
|
2
2
|
|
3
|
-
This is the official Ruby
|
4
|
-
|
5
|
-
Roost is the easy way to send Safari Push Notifications to your website visitors.
|
6
|
-
Desktop Push Notifications provide a new marketing channel to drive visitors back to your site.
|
7
|
-
With Safari on OS X Mavericks, visitors receive notifications in the top right corner of their computer screen.
|
8
|
-
This ‘gentle’ touch is great for status updates or trending information. To learn more see roost.me
|
3
|
+
This is the official Ruby gem for the Roost API.
|
9
4
|
|
5
|
+
[Web Push by Roost](https://goroost.com) allows websites to send notifications to their site visitors for
|
6
|
+
updates about new posts, content, or other information. Available in Chrome (Android and desktop) and Safari (desktop).
|
10
7
|
|
11
8
|
## Installation
|
12
9
|
|
@@ -24,15 +21,18 @@ Or install it yourself as:
|
|
24
21
|
|
25
22
|
## Usage
|
26
23
|
|
27
|
-
To send notifications you first need to create an account on
|
24
|
+
To send notifications you will first need to create an account on the [Roost website](https://goroost.com).
|
28
25
|
|
29
|
-
|
30
|
-
These can be found in the
|
31
|
-
If you are using the Heroku Add-On these are already configured for you.
|
26
|
+
Set your Roost app key and app secret to the following environment variables: ENV["ROOST_APPKEY"] / ENV["ROOST_APPSECRET"]
|
27
|
+
These can be found in the [Roost dashboard](https://dashboard.goroost.com) under settings -> API.
|
32
28
|
|
33
|
-
|
29
|
+
Easliy send notifications through Roost. Notifications incule text (alert) and a landing page URL (url).
|
34
30
|
```
|
35
|
-
|
31
|
+
alert = 'Thanks for subscribing for notifications'
|
32
|
+
url = 'https://goroost.com'
|
33
|
+
|
34
|
+
response = Roost::API.send({alert: alert,url: url})
|
35
|
+
|
36
36
|
if response['success'] == true
|
37
37
|
..success..
|
38
38
|
else
|
@@ -42,7 +42,7 @@ Once you have some registered Safari visitors on your site you can use the follo
|
|
42
42
|
|
43
43
|
## Contributing
|
44
44
|
|
45
|
-
1. Fork it (
|
45
|
+
1. Fork it ( https://github.com/RoostPush/Roost-Ruby-Gem )
|
46
46
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
47
47
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
48
48
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/roost.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'roost/version'
|
2
2
|
require 'json'
|
3
|
+
require 'net/http'
|
3
4
|
|
4
5
|
module Roost
|
5
|
-
|
6
|
-
|
6
|
+
class API
|
7
|
+
def self.send(opts)
|
7
8
|
opts = opts||{}
|
8
9
|
|
9
10
|
key = opts[:app_key]||ENV["ROOST_APPKEY"]
|
@@ -13,15 +14,15 @@ module Roost
|
|
13
14
|
raise "opts.alert must be given." if opts[:alert].nil? || opts[:alert].empty?
|
14
15
|
raise "opts.url must be given." if opts[:url].nil? || opts[:url].empty?
|
15
16
|
|
16
|
-
uri = URI.parse("https://
|
17
|
+
uri = URI.parse("https://go.goroost.com/api/push")
|
17
18
|
http = Net::HTTP.new(uri.host, uri.port)
|
18
19
|
http.use_ssl = true
|
19
20
|
request = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})
|
20
21
|
request.basic_auth key,secret
|
21
22
|
|
22
23
|
request.body = {
|
23
|
-
|
24
|
-
|
24
|
+
alert:opts[:alert],
|
25
|
+
url:opts[:url]
|
25
26
|
}.to_json
|
26
27
|
|
27
28
|
response = http.request(request)
|
@@ -29,11 +30,11 @@ module Roost
|
|
29
30
|
return JSON.parse(response.body)
|
30
31
|
else
|
31
32
|
return {
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
"success"=>false,
|
34
|
+
"message"=>response.message,
|
35
|
+
"code"=>response.code
|
35
36
|
}
|
36
37
|
end
|
37
|
-
|
38
|
-
|
38
|
+
end
|
39
|
+
end
|
39
40
|
end
|
data/lib/roost/version.rb
CHANGED
data/roost.gemspec
CHANGED
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'roost/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'roost'
|
8
8
|
spec.version = Roost::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.summary = %q{Official Roost
|
9
|
+
spec.authors = ['Roost', 'Dan Stever', 'Rick Byington']
|
10
|
+
spec.email = ['support@goroost.com']
|
11
|
+
spec.summary = %q{Official Ruby Gem for the Roost API.}
|
12
12
|
spec.description = %q{}
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = 'https://goroost.com'
|
14
|
+
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.5'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 2.6'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Roost
|
8
|
+
- Dan Stever
|
8
9
|
- Rick Byington
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: bundler
|
@@ -55,7 +56,7 @@ dependencies:
|
|
55
56
|
version: '2.6'
|
56
57
|
description: ''
|
57
58
|
email:
|
58
|
-
- support@
|
59
|
+
- support@goroost.com
|
59
60
|
executables: []
|
60
61
|
extensions: []
|
61
62
|
extra_rdoc_files: []
|
@@ -68,7 +69,7 @@ files:
|
|
68
69
|
- lib/roost.rb
|
69
70
|
- lib/roost/version.rb
|
70
71
|
- roost.gemspec
|
71
|
-
homepage:
|
72
|
+
homepage: https://goroost.com
|
72
73
|
licenses:
|
73
74
|
- MIT
|
74
75
|
metadata: {}
|
@@ -88,8 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
89
|
version: '0'
|
89
90
|
requirements: []
|
90
91
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.4.5
|
92
93
|
signing_key:
|
93
94
|
specification_version: 4
|
94
|
-
summary: Official Roost
|
95
|
+
summary: Official Ruby Gem for the Roost API.
|
95
96
|
test_files: []
|