npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-fitbit-leaders

v2.3.2

Published

Hubot Fitbit Leaders

Downloads

52

Readme

Hubot Fitbit Leaders

npm version Node CI

This script is designed to be used with a Hubot to compare the Fitbit activity of your friends.

Adding to Your Hubot

See full instructions here.

  1. npm install hubot-fitbit-leaders --save (updates your package.json file)
  2. Open the external-scripts.json file in the root directory (you may need to create this file) and add an entry to the array (e.g. [ 'hubot-fitbit-leaders' ]).

Commands

  • hubot fitbit setup - Run through the setup process for the bot (for admins)
  • hubot fitbit leaders - Show table of leaders
  • hubot fitbit register - Show how to friend the bot
  • hubot fitbit approve - Approve all pending requests

Upgrading from 1.0.x?

You will need to update your FITBIT_CLIENT_ID and generate a new FITBIT_OAUTH_TOKEN using the steps below. You no longer need the FITBIT_OAUTH_TOKEN_SECRET configuration variable. Note that you will have to go through this process at least once a year (the Implicit grant type token is time-limited.)

Configuration

| Environment Variable | Description | | -----------------------| ------------------------------------------------| | FITBIT_CLIENT_ID | Obtained from the app registration. | | FITBIT_CLIENT_SECRET | Obtained from the app registration. | | FITBIT_REDIRECT_URL | Redirect URL, must mach app registration. | | FITBIT_OAUTH_TOKEN | Found in the callback response, lasts one year. |

Register the three values as environment variables when starting your bot (as usual with Hubot scripts) using export or heroku config:set or whatever applies to your Hubot hosting environment.

Suggested Setup

  • Decide whether you want to use a user account or create a "robot" account to use with Fitbit
  • Go to the Fitbit Developer App Registration Page and register an application
  • The "Callback URL" field can be any running public web server. I prefer to use a RunScope bucket.
  • The "OAuth 2.0 Application Type: is "Client"
  • The application will need "Read & Write" access (for friend requests)
  • Note the Client ID and Client Secret. Go ahead and add those to your configuration file and restart Hubot.
  • Run the Fitbit setup command, e.g. hubot fitbit setup
  • A URL will be displayed that contains your configured Client ID, but is missing the registered callback URL. Plug that in, then go through the authorization steps.
  • Upon a successful authorization, the URL will appear in your browser containing your access token. It's very long, so make sure you grab everything between the = and the next &. Place these values into your configuration and restart Hubot.
  • If all went well, type hubot register and see if you receive a response.

Troubleshooting

  • Remember that the token expires after a year, so be prepared to go through these steps at least that often (replacing the Access Token).
  • Double check your saved configuration to make sure it matches the values displayed in the Fitbit application.
  • The callback step is a bit tricky. The few times I've run it, I ended up with a server error, but was still able to retrieve the Access Token from the URL.