Home / Extras / snp-send
Name Modified Size InfoDownloads / Week
Parent folder
snp-send-0.5.zip 2015-02-02 3.8 kB
readme 2015-02-02 2.1 kB
snp-send-0.4.zip 2015-02-02 3.7 kB
snp-send-0.3.zip 2015-02-01 3.6 kB
snp-send-0.2.zip 2015-02-01 3.3 kB
snp-send-0.1.zip 2015-01-31 1.0 kB
Totals: 6 Items   17.5 kB 0

snp-send 0.5

Copyright (c) 2015 full phat products

This is a Python 3 script which will send notifications to Snarl using SNP (Snarl Network Protocol) 3.0.  This script should work on all Python-supported platforms and is designed to be compatible with Python 3.2 and upwards.

Changes
-------

0.5 - Even more Python 3.2 friendly
      Added -n (sound to play) option

0.4 - Modified socket exception handling to work better on Python 3.2

0.3 - No longer dependent on ipaddress module

0.2 - Added sticky, priority and callback options
      Better option handling  
      More robust packet building
      Validates IP address using ipaddress module

0.1 - initial version


Basic usage
-----------

Synopsis:

snp-send [-b body] [-c callback] [-d ip] [-i icon] [-p port] [-r priority] [-s] [-t title] 

Options:

  -b    Notification body
  -c    Callback URL, !bang command or @signal
  -d    Destination IP address (default is 127.0.0.1)
  -i    Url, !system icon or UNC path to image file
  -n    Sound file to play
  -p    Destination TCP port (default is 9887)
  -r    Notification priority.  Must be between -2 and +2.  Default is 0
  -s    Requests notification to be displayed sticky (infinite duration)
  -t    Notification title

Notes
  - At least one of title, body or icon must be supplied.


Examples
--------

Send "Hello, world!" to 192.168.1.1:
	python3.4 snp-send.py -d 192.168.1.1 -b 'Hello, world!' -i '!system-info'

Urgent priority:
	python3.4 snp-send.py -d 192.168.1.1 -b 'Urgent' -i '!system-warning' -r 2

Sticky:
	python3.4 snp-send.py -d 192.168.1.1 -b 'Sticky' -s

Sticky:
	python3.4 snp-send.py -d 192.168.1.1 -b 'Get Snarl!' -c http://www.getsnarl.info

Send "Hello, world!" to 192.168.1.1, port 4444:
	python3.4 snp-send.py -d 192.168.1.1 -p 4444 -b 'Hello, world!'


Additional Information
----------------------

Some shells do not like exclamation marks in a command line.  Typically enclosing any exclamation marks in single quotes resolves this issue.

This script is in the very early stages of development!  More features will be added in due course.

Source: readme, updated 2015-02-02