Project

jawbit

0.0
No commit activity in last 3 years
No release in over 3 years
Handle Fitbit and Jawbone subscription notifications within a Rails or Rack app, and pass them on via ActiveSupport::Notifications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.6.2
~> 3.0.0.beta2

Runtime

>= 1.3.0
>= 0
 Project Readme

Jawbit

For receiving Fitbit, Jawbone and/or Validic subscription requests in a Rails (or Rack) app.

Installation

Add this line to your application's Gemfile:

gem 'jawbit', '0.1.0'

Usage

# in config/routes.rb
post '/fitbit/subscriptions', to: Jawbit::FitbitRack.new(
  subscriber_id, consumer_secret
)
post '/jawbone/subscriptions', to: Jawbit::JawboneRack.new
post '/validic/subscriptions', to: Jawbit::ValidicRack.new

# in an initialiser:
ActiveSupport::Notifications.subscribe('notification.fitbit') do |*args|
  event = ActiveSupport::Notifications::Event.new *args
  # use event.payload[:json] however you like.
end

ActiveSupport::Notifications.subscribe('notification.jawbone') do |*args|
  event = ActiveSupport::Notifications::Event.new *args
  # use event.payload[:json] however you like.
end

ActiveSupport::Notifications.subscribe('notification.validic') do |*args|
  event = ActiveSupport::Notifications::Event.new *args
  # use event.payload[:json] however you like.
end

Contributing

  1. Fork it ( https://github.com/[my-github-username]/jawbit/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Licence

Copyright (c) 2014, Jawbit is developed and maintained by Inspire9, and is released under the open MIT Licence.