Sending notifications through Pushbullet on Raspberry Pi
Pushbullet is a very useful service.
Users can send & receive notifications of various types(message, url, file, …) through it, and all those notifications are synchronized across all of their devices.
It even provides HTTP APIs, for free.
I used to receive status report email of my Raspberry Pi server every morning, and I made up my mind to replace the report system to Pushbullet.
With following content, you too, will be able to send Pushbullet notifications on your Raspberry Pi:
0. Prerequisite
Ruby needs to be installed on the machine. If it isn’t yet, you can get it done with this script.
1. Install pushbullet-ruby gem
You can find further information about this gem here.
2. Get your Pushbullet access token
Visit this page and get your access token.
3. Get a sample Ruby script
This is a sample ruby script that sends basic status of Raspberry Pi.
Edit ACCESS_TOKEN value to yours.
4. Try running
Now run the script in the terminal.
Then you’ll receive a Pushbullet notification immediately that is filled with the status report of your Raspberry Pi.
5. Run it periodically
You can run commands periodically using Cron.
Add following line for running it at 6AM every morning:
6. Now, do your own things
Based on this script, you can add or change stuffs for your use.
For example, you can send notifications
- when fail2ban spotted an intruder in your system,
- when transmission-daemon finished a download,
- … and so on!
Have fun with Pushbullet! :-)