Coder Social home page Coder Social logo

arjunreddyd / lifebot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cjroth/lifebot

0.0 0.0 0.0 183 KB

Use Google Sheets to log your life by texting it Emojis and pulling in data from Fitbit automatically.

Home Page: http://cjroth.com/lifebot-life-logging-via-text-message

License: MIT License

JavaScript 100.00%

lifebot's Introduction

Use Google Sheets to log your life by texting it Emojis and pulling in data from Fitbit automatically.

Screenshot

The driving philosophy behind this is finding the path of least resistance to life logging. Pull as much data as possible from other passive tracking sources, like Fitbit, automatically. Make it easy as fuck to update the spreadsheet... single-character text messages ☕️. No apps to install. Use Google Sheets because they are easy and you probably already have a Google account.

Install

Make sure you have Node 7 or later installed (it needs to support ES6). Sorry... this is kind of a pain to set up. OAuth 2 isn't much fun.

yarn install or npm install yarn global install or npm install -g to install the command line tool

Google Sheets

  1. Create a Google Sheets spreadsheet. Create a header row with column names. Make sure one of them is called "Date".
  2. Grab the spreadsheet ID and worksheet ID. Google how to find those on your own.
  3. Go to https://console.google.com and create an app. Follow instructions here to get your auth credentials.

Setup

  1. Copy sample.env to .env.
  2. Copy emoji-map.sample.json to emoji-map.json. Edit it so that the column names match the columns in your spreadsheet. Add all the columns you want. Removing columns might break things because it expects certain columns to exist for the Fitbit stuff. Sorry about that.
  3. Set up an account on Twilio. Register a phone number with them. Set it up to receive texts. Get your auth credentials and put it in the .env file.
  4. Run middleman.js on a public IP address. I recommend using Gomix.com for this - just copy and paste the code on there and update the callback URL. This will receive SMS messages from Twilio and then proxy them to server.js via a socket.io connection as JSON objects. Once you've done that, update MIDDLEMAN_URL in your .env file with the location of your middleman.js server.
  5. Set up an application on https://dev.fitbit.com with the Authorization flow. Go to http://<where ever your middleman.js script is hosted>/fitbit/auth. Grab the code that it returns and put it in your .env file as FITBIT_AUTH_CODE. Also update FITBIT_CLIENT_ID and FITBIT_CLIENT_SECRET which you can get from Fitbit.
  6. Run server.js anywhere you want. This will open a connection (via socket.io) to the middleman.js server and listen for SMS events. The middleman.js script will proxy SMS events from Twilio to the server. This allows you to run the server and develop behind a firewall or on a private network.

Sending Text Messages

Try sending a text message to the phone number you registered with Twilio... perhaps try ☕️. This should update your spreadsheet.

Command Line Use

Since you installed this package globally (-g or global), you can use the command lifebot to pull in the latest Fitbit data for today. You can specify a different day by adding a date, lifebot 2017-01-22. Or you can specify a range of dates lifebot 2017-01-01 2017-01-22. The dates don't have to be in order.

This allows you to update days retroactively. You shouldn't actually need to use this because the server will do this every day automatically at the time specified in your .env file.

lifebot's People

Contributors

cjroth 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.