Fitbit Subscriptions
For receiving Fitbit subscription requests in a Rails (or Rack) app.
Installation
Add this line to your application's Gemfile:
gem 'fitbit_subscriptions', '0.0.1'
Usage
# in config/routes.rb
post '/fitbit/subscriptions', to: FitbitSubscriptions::Rack.new(
subscriber_id, consumer_secret
)
# in an initialiser:
ActiveSupport::Notifications.subscribe('notification.fitbit') do |*args|
event = ActiveSupport::Notifications::Event.new *args
# use event.payload[:json] however you like.
end
Contributing
- Fork it ( https://github.com/[my-github-username]/fitbit_subscriptions/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Licence
Copyright (c) 2014, Fitbit Subscriptions is developed and maintained by Inspire9, and is released under the open MIT Licence.