One Man's attempt at making a scoreboard for beer hockey
I managed to create a Counter which can be used for any number of things. I am using it as a scoreboard for beer league hockey I play. (Technically I am using three different counters. One for a score for each team, and 1 for the period of the game) But this could be used as a Bad Joke counter, or a Death Counter, or any other things. This counter is set and updated Via Nightbot commands. And then displayed within the Stream on a local HTML page.
You can create any number of Keys (Counters you want) with this API.
The Counter Site
https://counterapi.dev/ API Main Website
https://counterapi.dev/api/endpoints.html API EndPoints
API URL
|name|required|description||---|---|---||name|yes|Namespace for the counter||key|yes|Counter name|
https://api.counterapi.dev/v1/**Name**/**Key**/ -Get Value of Key //NOTE There is a 60 second cache on Get Valueshttps://api.counterapi.dev/v1/**Name**/**Key**/UP -Increment Value of Key by 1https://api.counterapi.dev/v1/**Name**/**Key**/DOWN -Decrease Value of Key by 1https://api.counterapi.dev/v1/**Name**/**Key**/UP -Increment Value of Key by 1https://api.counterapi.dev/v1/**Name**/**Key**/set?count=1 -Set Value of Key to Number specified (Can not be Zero)
//To set a Count to Zero. You can set the Key to ONE. Then Decrease the value of the key
Nightbot Commands
The Following is NightBot code. You add this to a "Nightbot" message, and running it will update the count.
Player 1 has Scored/Leveled/Died. The Current count is $(eval a=$(urlfetch json https://api.counterapi.dev/v1/**Name**/**Key**/); a.count)
This code can show you current count of the Count.