LoginSignup
4
3

More than 5 years have passed since last update.

家族のLINEグループに毎朝Trelloのリストを送信すると便利

Last updated at Posted at 2018-11-29

家族でTrello買い物リストを使っているけどなかなか使うのが面倒で、「やっぱりLINEが便利っしょ」ということでLINEに送るようにすると便利でした。

ちなみにその昔はRemember The Milk1というサービスが好きでよく使ってました。懐かしい!

トークン類の取得

下記のトークンなどを取得します。

名前
Trelloのキー
Trelloのトークン
TrelloのリストID
LINE Notifyのトークン

Trello

キーとトークンを取得します。
https://trello.com/app-key

LINE Notifyのトークン取得

LINE Notifyのトークンを取得します。
https://notify-bot.line.me/ja/

トークン名が通知名になるので短めの名前がオススメです。

コード

jqを入れておきます。

jq コマンドを使う日常のご紹介

下記のコードに四種類のIDとトークンをセットします。

notify.sh
#!/bin/bash

#set -xe

TRELLO_KEY=xxxxxxx
TRELLO_TOKEN=xxxx
TRELLO_LIST_ID=xxxxx
LINE_TOKEN=xxxxx

TASKS=`curl  "https://api.trello.com/1/lists/${TRELLO_LIST_ID}/cards?key=${TRELLO_KEY}&token=$TRELLO_TOKEN" | jq -r '.[].name'`

curl -X POST -H "Authorization: Bearer ${LINE_TOKEN}"  \
  -F "message=$TASKS" https://notify-api.line.me/api/notify

このコードを適当なホストでcronで回しておきます。

動かすと

Trelloのリストの中身はこんな感じです。

image.png

送られる内容はこうです。

image.png

便利!

IFTTT

最初はIFTTTでできるかと思ったんですが、時間+Trello+LINEという組み合わせが出来ず…。
IFTTTでできそうだったら是非教えてください!

参考

超簡単 LINE notify を使ってみる

Trello API を叩いてカードを作成する方法(curl利用)

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3