31
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

メモ:PushbulletでRaspberry Piからスマホ/デスクトップにプッシュ通知を投げる

Last updated at Posted at 2015-06-14

時間のかかる処理の終了通知で投げると便利。

内容はPushbullet APIのサンプル記述のまま。もちろんだけど、Raspberry Piでなくても使える。

事前にapt-getでcurlをインストールし、Accountページからアクセストークンを取得すること。

push.sh
#!/bin/bash
CURL=/usr/bin/curl
PUSHBULLET_TOKEN=YourPushbulletAccessToken
PUSHBULLET_TITLE=Raspberry\ Pi

LANG=ja_JP.utf8

${CURL} --header "Access-Token: ${PUSHBULLET_TOKEN}" \
        --header "Content-Type: application/json" \
        --request POST \
        --data-binary "{\"type\": \"note\", \"title\": \"${PUSHBULLET_TITLE}\", \"body\": \"$1\"}" \
        https://api.pushbullet.com/v2/pushes

テスト。

$ push.sh "ごはんですよは、桃屋ですよ!"

PCの結果。

キャプチャ.JPG

Androidの結果。

キャプチャ2.jpg

31
34
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
31
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?