Gulag Counter Command

This is possible using the following 3 commands all credit goes to @RokettoJanpu for the commands and @ehsankia for the API:

This is possible using ehsankia’s quote custom API - read more about it here .

Click this link . It will generate three links and two tokens, a public token (8 characters long) and a private token (16 characters long). The public token is located within the first generated link. The private token is located within both the second and third generated links. The tokens are found after token= and before &data=$(querystring) Copy them and keep them somewhere safe !

!addwin which adds a win to the running score (mod-only)
!addkill which adds a kill to the running score (mod-only)
!score which displays the numbers of wins and kills

Either copy and paste these commands into chat or add them through the Nightbot dashboard . Add the commands through chat only if you are sure no one else is there, otherwise they might see your private token (which is used to edit the list)! Replace PUBLIC_TOKEN with your public token and PRIVATE_TOKEN with your private token.

!addcom -ul=mod !gulagw $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=win)`;` `) $(channel) just won a gulag!
!addcom -ul=mod !gulagl $(eval a=`$(urlfetch http://twitch.center/customapi/addquote?token=PRIVATE_TOKEN&data=loss)`;` `) $(channel) just lost a gulag!
!addcom -cd=5 !gulag $(eval a=`$(urlfetch json http://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`;w=a.match(/win/g)!=null?a.match(/win/g).length:0;k=a.match(/loss/g)!=null?a.match(/loss/g).length:0;`$(channel) has ${w} wins and ${k} loss.`)

Feel free to change the responses of !gulagw and !gulagl just as long as the $(eval) variables remain untouched!