Steve Kemp b493f19a4c Bumped dependencies | 6 ヶ月 前 | |
---|---|---|
.github | 10 ヶ月 前 | |
webhook | 6 年 前 | |
LICENSE | 6 年 前 | |
README.md | 5 年 前 | |
go.mod | 6 ヶ月 前 | |
go.sum | 6 ヶ月 前 | |
rss2hook.go | 10 ヶ月 前 | |
sample.cfg | 6 年 前 |
This project is a self-hosted utility which will make HTTP POST requests to remote web-hooks when new items appear in an RSS feed.
I have a couple of webhooks in-place already which will take incoming HTTP submissions and "do stuff" with them, for example:
I also have a bunch of RSS feeds that I follow, typically these include github releases of projects. For example my git-host runs gitbucket so I subscribe to the release feed of that, to ensure I'm always up to date:
There are two ways to install this project from source, which depend on the version of the go version you're using.
If you prefer you can fetch a binary from our release page. Currently there is only a binary for Linux (amd64) due to the use of cgo
in our dependencies.
go get -u github.com/skx/rss2hook
git clone https://github.com/skx/rss2hook ;# make sure to clone outside of GOPATH
cd rss2hook
go install
There are two parts to the setup:
For the first create a configuration-file like so:
http://example.com/feed.rss = https://webhook.example.com/notify/me
(There is a sample configuration file sample.cfg which will demonstrate this more verbosely.)
You can use your favourite supervision tool to launch the deamon, but you can test interactively like so:
$ rss2hook -config ./sample.cfg
There is a simple webserver located beneath webhook/ which will listen upon http://localhost:8080, and dump any POST submission to the console.
You can launch it like so:
cd webhook/
go run webhook.go
Testing it via curl
would look like this:
$ curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"blah","password":"blah"}' \
http://localhost:8080/
The sample.cfg file will POST to this end-point so you can see how things work:
$ rss2hook --config=sample.cfg
~/.rss2hook/seen/
.This repository is configured to run tests upon every commit, and when pull-requests are created/updated. The testing is carried out via .github/run-tests.sh which is used by the github-action-tester action.
Releases are automated in a similar fashion via .github/build, and the github-action-publish-binaries action.