Author Topic: Send PushBullet Notifications from VC  (Read 2524 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Send PushBullet Notifications from VC
« on: May 19, 2015, 09:54:20 PM »
for these commands to work you will need to get your PushBullet API Key from your account settings, you will also want to change your device names to something simple to say, instead of the device names, this can also be done in your account settings 

okay with that done, there are 3 commands in the attached group

command number 1 is a map creator for all your PushBullet devices, in this command there are 2 actions that you need to put your API key in scrape.get and Map.set where it says  YOUR_API_KEY_HERE

command number 2 is a command that sends a notification to all devices in your account
you can add a title and text to the notification by replacing Note Title and Note Body with the title and text you wish

command number 3 is a command that can send a notification to a specific device by name
you will need to change the payload to match your device nicknames (the names you gave them in your account settings)
you can add a title and text to the notification by replacing Note Title and Note Body with the title and text you wish

Send Push Bullet Notifications
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<commandGroup open="True" name="Send Push Bullet Notifications" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="928" name="Create Pushbullet Map !! you need to add your API Key !!" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="500" loopMax="50" description="">
    <action>
      <cmdType>Scrape.Get</cmdType>
      <params>
        <param>https://api.pushbullet.com/v2/devices</param>
        <param />
        <param />
        <param />
        <param>json</param>
        <param>Authorization: Bearer YOUR_API_KEY_HERE</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>{"active":true,"iden":"(.*?)".*?"nickname":"(.*?)"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.CreateTable</cmdType>
      <params>
        <param>Pushbullet</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Pushbullet</param>
        <param>{Match.{i}.2}</param>
        <param>{Match.{i}.1}</param>
      </params>
      <cmdRepeat>{#M}</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Pushbullet</param>
        <param>API Key</param>
        <param>YOUR_API_KEY_HERE</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="831" name="BASIC Pushbullet notification (All devices)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="500" loopMax="50" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>https://api.pushbullet.com/v2/pushes</param>
        <param>{"type": "note", "title": "Note Title", "body": "Note Body"}</param>
        <param />
        <param />
        <param>application/json</param>
        <param>Authorization: Bearer {M:Pushbullet.API Key}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>test Push Bullet notifications for all devices</phrase>
  </command>
  <command id="854" name="Push to {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="500" loopMax="50" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>https://api.pushbullet.com/v2/pushes </param>
        <param>{"device_iden":"{M:Pushbullet.{1}}", "type": "note", "title": "Note Title", "body": "Note Body"}</param>
        <param />
        <param />
        <param>application/json</param>
        <param>Authorization: Bearer {M:Pushbullet.API Key}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Test Push bullet Notification to </phrase>
    <payloadList>My Cell Phone, My Laptop, My Tablet</payloadList>
  </command>
</commandGroup>
« Last Edit: April 17, 2016, 02:03:50 AM by PegLegTV »

DexDeadly

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Send PushBullet Notifications from VC
« Reply #1 on: April 16, 2016, 10:59:08 PM »
So I found this and its great.  One thing I found is that when I tried to use it now though, when it was trying to create the map table the regex was not mapping anything.  I don't know if this could of been due to the API being changed since original post.  So for me to get this to work I removed "pushable":true}, from the regex line and it then started to work.  Thought I'd note that incase anyone else ran into the same issue that I did.   

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Send PushBullet Notifications from VC
« Reply #2 on: April 17, 2016, 02:04:39 AM »
Thanks for the heads up, I updated the Command in the first post to show the changes