Skip to content

Commit 717754e

Browse files
author
Brian Abelson
committed
updated readme
1 parent 02d3715 commit 717754e

File tree

3 files changed

+56
-3
lines changed

3 files changed

+56
-3
lines changed

fitbite.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def determine_calorie_level(fb, config):
2929
levels = config['levels']
3030
the_calorie_level = levels[0].keys()[0]
3131
for l in levels:
32-
calorie_level, step_level = l.keys()[0], l.values()[0]
32+
calorie_level, step_level = l.keys()[0], l.vsalues()[0]
3333
if step_level < steps:
3434
the_calorie_level = calorie_level
3535

@@ -88,4 +88,5 @@ def order_seamless(calorie_level):
8888
config = load_config()
8989
fb = authorize_with_fitbit()
9090
calorie_level = determine_calorie_level(fb, config)
91-
print order_seamless(re.sub("_", " ", calorie_level))
91+
92+
print order_seamless(calorie_level))

imgs/fav_meals.png

76.3 KB
Loading

readme.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,56 @@
1313
\\
1414
'--`
1515
```
16-
Order food from Seamless based on your Fitbit activity for the day.
16+
Order one of your favorite meals from Seamless based on your Fitbit activity for the day.
17+
-----------------------------------------------------------------------------------------
18+
19+
## Dependencies
20+
First, you'll need to set the following 6 Environmental Variables. The easy way is to just add these to `
21+
~/.bash_profile` or `~/.zshrc`, depending on which shell you use.
22+
23+
```
24+
export SEAMLESS_EMAIL='name@email.com'
25+
export SEAMLESS_PASSWORD='mehungry'
26+
export FITBIT_CONSUMER_KEY='wwwwwwwwwwwwwwwwwwwwww'
27+
export FITBIT_CONSUMER_SECRET='xxxxxxxxxxxxxxxxxxxx'
28+
export FITBIT_USER_KEY='yyyyyyyyyyyyyyyyyy'
29+
export FITBIT_USER_SECRET='zzzzzzzzzzzzzzzzz'
30+
```
31+
32+
Then you'll need to install [`python-fitbit`](https://github.com/orcasgit/python-fitbit) like so:
33+
34+
```
35+
git clone https://github.com/orcasgit/python-fitbit.git
36+
cd python-fitbit
37+
sudo python setup.py install
38+
```
39+
40+
You'll also need to make sure you have `selenium` for python installed:
41+
42+
```
43+
sudo pip install selenium
44+
```
45+
And have downloaded Firefox from [here]((http://www.mozilla.org/en-US/firefox/new/))
46+
47+
## Assumptions
48+
1. Your CC info is saved on Seamless
49+
2. You're at your home (default) address on Seamless.
50+
51+
## Setup
52+
`fitbite` works by querying your fitbit activity for the today, comparing it to set of arbitrary tags and step levels in `fitbite.yaml` and then ordering one of your favorite meals from Seamless which have been named with the same tags.
53+
54+
See an example list of my favorite meals:
55+
![fav_meals](imgs/fav_meals.png)
56+
57+
The names of each meal match the tagged calorie levels set in [`fitbite.yaml`](fitbite.yaml):
58+
```
59+
levels:
60+
- LOW_CALORIES: 5000
61+
- MEDIUM_CALORIES: 10000
62+
- HIGH_CALORIES: 15000
63+
```
64+
65+
## Runtime
66+
When your ready to run fitbite, just type `python fitbite.py`. That's it.
67+
68+

0 commit comments

Comments
 (0)