Twitch Giveaway Chrome

Nightbot is a chat bot for Twitch and YouTube that allows you to automate your live stream's chat with moderation and new features, allowing you to spend more time entertaining your viewers.

May 29th, 2015

Twitch Giveaway Wheel

Never
Twitch
  1. When a stream is loaded with Chrome dev tools open, I found queries to many hostnames, like mp.twitch.tv, usher.twitch.tv, api.twitch.tv, etc To narrow down the results, I decided to block these hostnames one at a time to see if they were important. I ended up with a few required ones, namely usher.twitch.tv.
  2. You need to enable JavaScript to run this app. You need to enable JavaScript to run this app.
  3. Twitch Prime is included with an Amazon Prime account but isn’t automatically activated. If you already use Twitch, you just have to link Twitch to your Prime account. It only takes a few steps to start claiming your free games and in-game items.

Twitch Giveaway Rules

Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
  1. // if you open up developer tools in chrome and go to the console tab, you can paste
  2. // in this snippet of javascript it will get all ur users into an array and pick a random
  3. function httpGet(url){
  4. xmlHttp.open('GET', url,false);
  5. xmlHttp.setRequestHeader('Access-Control-Allow-Headers','*');
  6. xmlHttp.setRequestHeader('Content-type','application/ecmascript');
  7. xmlHttp.setRequestHeader('Access-Control-Allow-Origin','*');
  8. return xmlHttp.responseText;
  9. //set the twitch url: if u visit this url u will see all ur viewers in a json object format
  10. var url ='https://tmi.twitch.tv/group/user/venruki/chatters';
  11. //go get the json object and made it renderable
  12. var userJsonList = JSON.parse(userJsonListRaw);
  13. //set up an array we're gonna put the user list in
  14. //get the length of both the moderator section and viewer section
  15. var modCount = userJsonList.chatters.moderators.length;
  16. var viewerCount = userJsonList.chatters.viewers.length;
  17. //push all mods into the userArray
  18. userArray.push(userJsonList.chatters.moderators[i]);
  19. for(i=0; i < viewerCount; i++){
  20. userArray.push(userJsonList.chatters.viewers[i]);
  21. var roll =Math.floor((Math.random()* userArray.length)+1);
  22. //print a random name out of the user array based on that number
  23. //boom you have giveaways again without any chrome extensions!

Twitch Giveaway Overlay

Giveaway
RAW Paste Data