Giter Club home page Giter Club logo

fitbot's Introduction

fitbot

fitbot posts Strava activity to Slack.

http://i.imgur.com/2yvGuyL.jpg

Installation

  1. fitbot is a NodeJS module. You'll need to install that first. More information can be found here.
  2. Next, check out the fitbot code. git clone [email protected]:pifantastic/fitbot.git
  3. Install dependencies. cd fitbot && npm install
  4. Run fitbot. I use a tool called pm2. You can find more information about it here.
  5. npm install pm2 -g
  6. pm2 start index.js

Configuration

Start by copying the provided sample configuration:

cp config.sample.json config.json

Next, update the configuration for your purposes. Here are what the various options mean:

activity_check_interval (Default: 60000)

This is how often fitbot will check Strava for new activity, measured in milliseconds. You probably don't want to use too small of a number, or else you'll run into Strava API rate limits.

strava_clubs (Default: [])

This is an array of the Strava clubs in which to look for activities, and the corresponding webhook needed to post them to Slack. Here is an example of the format:

[
  {
    "id": 1234,
    "webhook": "https://hooks.slack.com/services/XXXX/XXXX/XXXX"
  }
]

id is the ID of the Strava club. This can be a bit challenging to figure out. A simple way to find it is to go to the webpage for the Strava club, and then click the Club Leaderboard link. You'll be taken to a new webapge whose URL contains the club's ID. For example: https://www.strava.com/clubs/123456.

webhook is a Slack incoming webhook. You can find more information on how to set these up here.

strava_token (Default: "")

This is a Strava API token. You can get one of these by creating a new Strava API application. More information on how to do that can be found here

NOTE: The user who created the Strava API application needs to be a member of all of the clubs configured in strava_clubs for fitbot to work!

slack_name (Default: "fitbot")

This is the name fitbot will use when posting activites to Slack.

slack_icon (Default: "http://i.imgur.com/2E6yJjV.png")

This is the icon that fitbot will use when posting activities to Slack.

FAQ

  1. Why does fitbot display athlete names with a . after the first letter?

This prevents fitbot from alerting users when it posts to Slack.

Changelog

1.1.0

fitbot maintains a list of activities to prevent reposting activities it has already posted. Historically that list has been kept in memory. This, however, means fitbit did not persist across restarts/crashes, causing it to occasionally bomb slack with lots of activities that had already been posted. Version 1.1.0 uses a file-backed database to maintain the list of activities to avoid this.

1.0.0

Initial release.

License

Copyright (c) 2016, Aaron Forsander

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

fitbot's People

Contributors

aaron-stripe avatar eightysteele avatar pifantastic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.