@ljunkie - Kind of a further to this query.. Is it possible to tweak it so I can send a pushbullet notification to my custom channel? I share my library with friends & family and would like to allow them the ability to subscribe to new episode notifications at their leisure. To do so I would need to be able to set the channel_tag field, as per the pushbullet API page snippet below:
This is an amazing plugin btw, thank you very much.
...
I second this, It would be great to be able to push to a channel.
Edit: I looked into this a little more.
Looking at the plexwatch.pl file, specifically the NotifyPushbullet() function on lines 2453 - 2511, there appears to be the call to the Pushbullet API on line 2490. It appears that the call is to the V1 API but the channels feature is a part of the V2 API. I'm guessing that changing the call to use the V2 API instead of the V1 API would solve this.
So line 2490:
my $response = $ua->post( "https://$po{'apikey'}\@api.pushbullet.com/api/pushes", [
becomes:
my $response = $ua->post( "https://$po{'apikey'}\@api.pushbullet.com/v2/pushes", [
I realize that this is for the Linux side of the equation and this is the Windows build thread. Being unable to look at the code for the Windows version I can't be sure but I'm guessing that the call is identical.
Edit:
To test this I setup the Linux version of plexWatch. Making the aforementioned change and adding the channel_tag variable to the config.pl and plexwatch.pl files I was able to push to a channel.
The config.pl file now looks like this:
'pushbullet' => {
'enabled' => 1,
'push_recentlyadded' => 1,
'push_watched' => 1,
'push_watching' => 1,
'push_paused' => 1,
'push_resumed' => 1,
'title' => '{user}',
'apikey' => '', # Pushbullet API key https://ww$
'device' => '', # https://api.pushbullet.com/api/devices put yor API key as use$
'channel' => '', # Channel tag from https://www.pushbullet.com/my-channels
},
and the part of plexWatch.pl that handles the api calls to pushbullet looks like this:
my $response = $ua->post( "https://$po{'apikey'}\@api.pushbullet.com/v2/pushes", [
"device_iden" => $po{'device'},
"channel_tag" => $po{'channel'},
"type" => 'note',
"title" => $po{'title'},
"body" => $po{'message'},
]);
Yet another edit:
To test I tried the following:
- Input a channel tag in the config.pl file and leave the device id blank.
- Input a device id in the config.pl file and leave the channel tag blank.
- Leave the device id and channel tag blank.
This produces the following results:
- Pushes to the specified channel only.
- Pushes to the specified device only.
- Pushes to all devices associated with the API key.
@ljunkie: Use as you please. I have no experience using github so I have no idea how to proceed with this. Please advice if there's something I should do.