Remove websockets, readme, better UI
This commit is contained in:
parent
630ecd351f
commit
a66bd6dad7
4 changed files with 133 additions and 100 deletions
46
README.md
46
README.md
|
@ -1,10 +1,44 @@
|
|||
# ntfy
|
||||
|
||||
ntfy is a super simple pub-sub notification service. It allows you to send desktop and (soon) phone notifications
|
||||
via scripts. I run a free version of it on *[ntfy.sh](https://ntfy.sh)*. No signups or cost.
|
||||
|
||||
echo "mychan:long process is done" | nc -N ntfy.sh 9999
|
||||
curl -d "long process is done" ntfy.sh/mychan
|
||||
publish on channel
|
||||
## Usage
|
||||
|
||||
curl ntfy.sh/mychan
|
||||
subscribe to channel
|
||||
### Subscribe to a topic
|
||||
|
||||
ntfy.sh/mychan/ws
|
||||
You can subscribe to a topic either in a web UI, or in your own app by subscribing to an SSE/EventSource
|
||||
or JSON feed.
|
||||
|
||||
Here's how to do it via curl see the SSE stream in `curl`:
|
||||
|
||||
```
|
||||
curl -s localhost:9997/mytopic/sse
|
||||
```
|
||||
|
||||
You can easily script it to execute any command when a message arrives:
|
||||
```
|
||||
while read json; do
|
||||
msg="$(echo "$json" | jq -r .message)"
|
||||
notify-send "$msg"
|
||||
done < <(stdbuf -i0 -o0 curl -s localhost:9997/mytopic/json)
|
||||
```
|
||||
|
||||
### Publish messages
|
||||
|
||||
Publishing messages can be done via PUT or POST using. Here's an example using `curl`:
|
||||
```
|
||||
curl -d "long process is done" ntfy.sh/mytopic
|
||||
```
|
||||
|
||||
## TODO
|
||||
- /raw endpoint
|
||||
- netcat usage
|
||||
- rate limiting / abuse protection
|
||||
- release/packaging
|
||||
|
||||
## Contributing
|
||||
I welcome any and all contributions. Just create a PR or an issue.
|
||||
|
||||
## License
|
||||
Made with ❤️ by [Philipp C. Heckel](https://heckel.io), distributed under the [Apache License 2.0](LICENSE).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue