OpenWhisk / today’s todoist to slack

Hideaki Tokida
Jan 26, 2017 · 2 min read

I check todo every day using todoist. and my team use slack. I use OpenWhisk’s Action to tell my team about today’s work.

Create Action

Use the following python code ( save totodoist2slack_openwhisk.py )

Use the wsk command-line to create a new Python Action using this python script.

wsk action action todaytodo todoist2slack_openwhisk.py

Set the default parameter to Python Action.

wsk action update todaytodo -p todoist_token XXXXX -p todoist_projectId XXXX -p slack_url https://hooks.slack.com/services/XXXXXXX

The “todoist_token” is `API token` in todoist application settings.

todoist_token

todoist_projectId : Select the `ID` of the project you want to target.

todoist_projectId

slack_url is slack webhook url. :-p

If you want to post to Slack at the same time every morning, it is good to sequence new actions using alert feed(like crontab event ) .

Invoke Action

wsk action invoke -r -b todaytodo

New message in slack posted by wsk action ivoke.

Result

OpenWhisk is very easy . If not openwhisk , we create some server ( For Python example, you need a flask application server) . It is troublesome. and OpenWhisk is reasonable that cost and architecture. Even if we use the action every day, it is a few yen :p

Hideaki Tokida

Written by

もっぱら最近はクラウド関連なのだけどそういえば昔は文房具とかライフハック的な事が好きだった。OpenWhisk/Docker/Ansible/AWS/Softlayer/Bluemix コメントは私の個人的見解で、必ずしも所属企業の立場、戦略、意見を代表するものではありません。

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade