Although Snarl itself currently only supports Windows operating systems, you can still send notifications to it from any platform that supports Python by using our snp31send.py tool.
Installation
There are two ways to get snp31send: cloning our Snarl Network Protocol tools repository; or downloading the script directly. To clone the repository, enter the following from a terminal or command prompt:
git clone https://github.com/fullphat/snarl_network_protocol.git
You can then find snp31send.py in /clients/generic/snp31send/
Requirements
The script relies on Python 2 which is more than likely already installed on your computer. If not, you can find installation instructions (and the latest version) here, but make sure you download the latest version of Python 2, not Python 3. You must also be running Snarl 5.0 or later.
Finally, Snarl itself must be listening for incoming SNP 3.1 notifications.
Testing
Launch a terminal, navigate to where you installed snp31send, and enter the following:
python snp31send.py
You should see the following returned:
snp31send.py: try 'python snp31send.py --help' for more information
So, try that:
python snp31send.py --help
You should see details of the arguments snp31send supports.
Sending a Notification
Let’s send a very simple notification to Snarl (note this example assumes Snarl is listening on port 6000 on the local computer; change this to suit your own configuration):
python snp31send.py 127.0.0.1 6000 -N -b "Hello, world"
You should see the following returned, and a notification appear on the computer running Snarl:
[ SNP/3.1 SUCCESS END ]