It works! Thanks for the quick fix. There’s just a PHP notice when the token isn’t valid, specified or if the channel isn’t partnered (most likely it’s just about handling the Twitch API response that has an error property set), but it shouldn’t be an issue for this use senario. For reference here’s the notice:
Notice: Undefined index: message in /home/rtainc/www/api.rtainc.co/twitch/random-sub.php on line 4
Could I ask you which RNG function you are using for the random drawing? When I’ve coded a similar feature I’ve noticed that it wasn’t giving me that of a random drawing with array_rand (in the case of a quick succession of drawings… as I’ve added the ability to have more than 1 drawing to be done at the same time), so I’ve used mt_rand and coded my own simple mt_rand_array in the end.
As far as I know there is only one output format for the following command. Unless another gets added, then your out of luck. You’re more than welcome to create your own customapi.
@rtainc hey man can you make an API command to read “SOLO MMR” or “Hero winrate” for DOTA (Defense of the ancients) from this website? dotabuff.com/players/114827878 … if you already have something like this, please share
Thanks for the suggestion! Unfortunately Dotabuff doesn’t provide any type of API, and I do not have any knowledge on how DotA stats are stored, so I am (at current) unable to do so. If you do end up finding any type of DotA Stats site with links to an API, I’ll be happy to implement it for a Nightbot command.
Hi can anyone please make a customapi to make nightbot answer like clever bot like !addcom nightbot $(customapi $(query)) so you could say Nightbot hello and nightbot would respond based on what you said if someone could do this I will be in debt to them forever
Please PM me the Twitch token and the subscriber’s Twitch name so I can look into it. Thanks!
There was one of these at some point that I saw, however it seems the site has gone down. I’d love to make one of these for fun some day but unfortunately right now I don’t have the time as it’s such an extensive project. If I do end up making one I’ll tag you.
Yea I saw that sadly the site is down. Thanks a lot the command isn’t needed straight away if you ever create the command for fun in a couple of months or a couple of years I’ll be very thankful
I am trying to integrate the latest subscriber name in my HTML5 overlay through Javascript/AJAX and looking for an API to retrieve the latest/newest subscriber rather than a random subscriber any possibility to realize this?
Curious thing is when I try to retrieve the information through javascript/AJAX and set the datatype to any other acceptable type than json it returns nothing in the .done() section. However if I set json as expected datatype it returns the data I need (msg.responseText) however it always triggers the .fail() of the AJAX call.
Yea I have looked into that of course but my problem was the oauth_token that I could not generate myself just for my own HTML overlay. But I am using now the token generated by the link above the main post and it works, so thanks
Any idea how long the oauth_token stays valid before I have to change it in my overlay code?