Last edited by Matthew Ogborne, 2016-03-07 08:58:21
Pushbullet is tool for receiving & sending messages, files etc... across platforms.
For example you can send a message aka "note" via your Onion Omega and then the note appears on all your connected devices, eg on your phone, iPad and even in your web browser. It's a bridge between them all!
What you could do with this is really up to you, here are a couple of ideas:
This simple example is using PHP, but you can easily do the same with any other programming language as it's just a POST request.
The process of installing PHP on your Onion Omega is covered in this tutorial:
However to be able to send curl requests, you'll need one additional library called "php5-mod-curl". You can install this by running these commands in your Onion Omega console:
opkg update opkg install php5-mod-curl
Now restart uhttpd by running:
Now go to your php folder and create a new file:
cd /www/php nano pushbullet.php
Then paste in the code below, changing your auth token you got from step 1:
<?php $authToken = "your auth token here!!!"; $curl = curl_init('https://api.pushbullet.com/v2/pushes'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_HTTPHEADER, ["Authorization: Bearer $authToken"]); curl_setopt($curl, CURLOPT_POSTFIELDS, [ "type" => "note", "title" => "Pushbullet Notification", "body" => "Howdy, this is a message sent from my from My Onion Omega!"] ); $response = curl_exec($curl); echo "<pre>"; print_r($response); echo "</pre>";
Save the file by pressing "Ctrl+X", pressing "y" and then "Enter"
Now open your web browser and go to http://omega-ABCD.local/php/pushbullet.php (chaging the url to your Onion Omega of course :) )
The world is your oyster. How about trying one of the dedicated PHP libraries for Pushbullet to make development faster?