- Python 3.8.7
- Flask 1.1.2
Notifier fitbit's activity info for AWS Lambda, deploying zappa. with management, https://github.com/KaitakuShiba/fitbit.
- Requirement fitbit.db file and set environment variable for AWS Lambda.
- ref: https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/configuration-envvars.html
- Edit IAM for zappa.
- ref: https://github.com/zappa/Zappa
$ pip install pipenv
$ cd this_project
$ pipenv --python 3.8
$ pipenv install -r requirements.txt
$ pipenv run python migrate.py
# create zappa setting
$ pipenv run zappa init
$ pipenv run zappa deploy dev
# after edit file
$ pipenv run zappa update dev
After zappa init, update setting.
{
"dev": {
"app_function": "app.app",
..
"events": [{
"function": "app.check_distance_job",
"expression": "cron(50 14 * * ? *)"
}],
"keep_warm": false
}
}
SLACK_BOT_TOKEN = ''
SLACK_CHANNEL = ''
CLIENT_ID = ''
CLIENT_SECRET = ''
SECRET_KEY = ''
ref: https://docs.pixe.la
# create user
curl -X POST https://pixe.la/v1/users -d '{"token":"token", "username":"username", "agreeTermsOfService":"yes", "notMinor":"yes"}'
# create graph
curl -X POST https://pixe.la/v1/users/username/graphs -H 'X-USER-TOKEN: token' -d '{"id":"grassgraph","name":"run-graph","unit":"achievement_rate","type":"int","color":"shibafu"}'
# check create graph
https://pixe.la/v1/users/username/graphs/grassgraph.html