update readme and add webhook php script

This commit is contained in:
Ben Harris 2018-10-23 10:13:56 -04:00 committed by Ben Harris
parent 5c2a2fca14
commit e2568c70da
2 changed files with 9 additions and 0 deletions

View File

@ -5,3 +5,6 @@ super simple bot
it:
* responds to pings
* sends a message to #tilderadio when `$now_playing_file` changes
drop webhook.php somewhere in a webroot and update `now_playing_file` in bot.properties to point to now_playing.txt in that dir.

6
webhook.php Normal file
View File

@ -0,0 +1,6 @@
<?php
// this makes a lot of assumptions but it works with azuracast webhooks
file_put_contents(
"now_playing.txt",
json_decode(file_get_contents('php://input'))->now_playing->song->text
);