emma wrote
An HTTP request that is made upon an event, such as commenting, occurring.
[deleted] wrote
emma wrote
Check out this script that uses Postmill's webhooks and which I think is pretty easy to learn from.
Fossidarity wrote
This link seems to be dead, is there a mirror location where I can learn about webhooks?
Fossidarity wrote
Thanks a lot! Still don't really know how to use it though...
leftous wrote (edited )
Follow the instructions in the archive link.
The setup is pretty straight forward, I did it on /f/readingclub/webhooks initially. websub.txt should be changed to websub.php...
To do it: First go to t2bots site, invite the bot, send the !webhook command, change the parameters in the websub.php file using the URL provided and whatever image you want to use. Upload the php script on your server
Then you just go on the forum you want/webhooks, post the url to the script with the password/secret token, and the bridge should work.
Fossidarity wrote
Aah thanks, so webhooks only work for Matrix clients?
leftous wrote
Oh not at all, you can use it for other applications but the script would need to be altered to suit your needs.
Emma explains the format of the data being submitted to the php script here:
https://gitlab.com/edgyemma/Postmill/blob/master/docs/webhooks.md
In this case, the script only handles new submissions and formats the data into a $text variable, then sends a POST request to the bot with some other bot data.
You can format the data any way you want and post it to any server you want, it would work the same.
Viewing a single comment thread. View all comments