A stupid simple notifier built on Pushover
Poke is a little notifier program that takes JSON or YAML configuration expressing a push notification to send to a device/group of devices via Pushover
It is designed to be simple, but powerful. It can read JSON or YAML from a file, or directly from stdin
.
Where example.json
looks like:
{
"token": "7wUXeEnLOEVLi5jMxkxHpCGT5TMweZ",
"recipient": "DOoPnaZ4Ya2MgyK8T4V40FctDFOpYb",
"title": "Poke!",
"message": "Hey check this out",
"url": "https://golang.org",
"url_title": "Golang",
"attachment": "./gopher.png"
}
$ poke example.json
Or, with example.yml
:
---
token: 7wUXeEnLOEVLi5jMxkxHpCGT5TMweZ
recipient: DOoPnaZ4Ya2MgyK8T4V40FctDFOpYb
title: Poke!
message: Hey check this out
url: https://golang.org
url_title: Golang
attachment: ./gopher.png
$ poke example.yml
Poke can read YAML or JSON expressions from stdin
.
Be it piped from the output of something else:
$ curl https://example.com/api/some_json_or_yaml | poke
Or Poke will read data directly if nothing is piped to it and it doesn't have a file argument:
$ poke
{
"token": "7wUXeEnLOEVLi5jMxkxHpCGT5TMweZ",
"recipient": "DOoPnaZ4Ya2MgyK8T4V40FctDFOpYb",
"title": "Poke!",
"message": "Hey check this out",
"url": "https://golang.org",
"url_title": "Golang",
"attachment": "./gopher.png"
}
^D
Note: ^D
here is CTRL+D - to indicate to Poke we're done
If you'd like to print some statistics from Pushover after your notification has been sent, you can use the -v
flag to get output like the following:
Request id: zc47c30b-3ff2-8a92-kl89-gg7b1b77z3gt
Usage 7449/7500 messages
Next reset : 2018-09-01 06:00:00 +0100 BST
Check out the examples for some simple scripts using Poke!
Lockscreen | Pushover |
---|---|
Poke is configured purely through the config you pass it, as shown above.
The only required parameters are token
, recipient
, and message
.
If you wish to exclude any of the other data, it can simply be left out.
These parameters can be used to provide an easily clickable link in your notification.
url
can be used on its own, but url_title
requires url
.
This parameter can be used to provide an attachment in your notification.
As per Pushover's 'Attachments' section in their API documentation, this must be an image. It will be displayed inline at the bottom of your notification.
Its value should be the local filesystem path to the image; relative or absolute. Support for remote images is coming soon! ๐ช
See the LICENSE file