はじめに
前回投稿した「pixelaでPCの利用状況を可視化する」でpixelaで手軽に活動記録を残せることがわかったので今回は、日々の体温計測結果をiPhoneのShortcutsアプリを使って手軽に残せる方法を紹介します。
体温記録用のグラフを作成
下記のコマンドを実行してグラフを作成します。<username>
は適宜設定してください。
% pi graphs create -u <username> -g body-temp -n "Body Temperature" -i celsius -t float -c ajisai -z Asia/Tokyo
これでpixelaの準備は完了です。
iPhoneのShortcutsの作成
Shortcutsアプリを起動し、「ショートカットを作成」をタップし、アクションを追加していきます。
- スクリプティング:今日の体温を尋ねる

- 日時:現在の日付を取得する

- テキスト:pixelaの更新用URLを設定する。
<username>
は適宜設定してください。

- 書類:pixelaの更新URLの日付部分を日時に置き換える。日時はカスタムフォーマットでpixelaのフォーマットに変換して置換する。

- Web:アップデートされたテキストからURLを取得する

- ネットワーク:URLの内容を取得する。
<UserToken>
は適宜設定してください。

- URL:pixelaグラフのURLを設定する。
<username>
は適宜設定してください。

- SAFARI:URLを開く

Shortcutsの実行結果
作成したショートカットをタップすると「今日の体温を」入力するポップアップが表示されます。
体温を入力し、「OK」ボタンを押下するとSafariが開き、グラフが確認できます。