Git Product home page Git Product logo

poke's Introduction

Go Report Card license

Poke ๐Ÿ‘‰

A stupid simple notifier built on Pushover

About

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.

From a file

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

From stdin

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

Verbosity

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

Examples

Check out the examples for some simple scripts using Poke!

Preview

Lockscreen Pushover

Configuration

Poke is configured purely through the config you pass it, as shown above.

Required parameters

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.

url/url_title

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.

attachment

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! ๐Ÿ’ช

Licensing

See the LICENSE file

poke's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.