Any help would be appriciated, as my php skills are lacking. I want to create a system that rewards viewers for watching the stream with tokens (like a form of currency specific to this website) say 5 tokens every 15 minutes.
I understand already that i will need to employ the use of MySQL and PHP, and I want to utilize the twitch api so that users can log into the website using their twitch account so the points will follow their account.
I have a general understanding of how to do it, i just need a little help with the actual scripting.
Thanks in advance for any help you’re able to offer!
Logging time in chat isn’t too hard, there are two main ways to do it - by having an IRC client that handles joins/leaves, or by polling the API (https://tmi.twitch.tv/group/user/ryevenge/chatters the TMI API is undocumented and may change without notice)
Making your web application from there really isn’t that different from any other application. You will need to find out how to make an application where user login/sign-up is done with OAuth2. Perhaps you can find a framework which does most of this for you out of the box (or seek out some tutorials).
If you’re willing to compromise, or want to see an example of how the TMI section can be done, LoyaltyBot is an open source twitch bot coded for this service. https://github.com/SupremoRTD/LoyaltyBot
Sounds good, looked at the documentation although i can’t seem to understand how to actually get the bot running. I’ve edited the files with the required information and uploaded them to the server, but now i’m not sure what to do.