Nuung / twitch-chat-raffle

Raffle system with twitch chatting (IRC connection).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twitch Chat (with IRC) Auto Raffle

About twitch IRC chat Offical DOCS
About IRC

Requirements

  • twitch.tv account
  • docker and docker-compose
  • do not use port 80(nginx), 3000(node, expree), 28018(mongo), 8000(python)

Getting Start

  1. you dont need to register "dev.twitch.tv".

  2. go >> https://twitchapps.com/tmi/ and get OAuth Token

  3. git clone https://github.com/Nuung/twitch-chat-raffle.git and cd twitch-chat-raffle

  4. go ./crawler/mongo.py - def db_migarte(self) and change (line 37, 38, 39, 43, 44)

        "nick_name": "qlgks1",
        "oauth_token": "oauth:xtft5hce1muhkjhyx01oeqa1td6acc",
        "channel_name": "aba4647",
  5. go ./app/.env and change PAGE_TITLE value to what you want

  6. finally, go ./docker and run script below

    source docker-start.sh

    and if you use docker desktop, you can see the container list below

  7. it's done! just go http:localhost

Guide

you can see the video guide this youtube page https://youtu.be/A73ys0J880g

about page useage

  1. you can change config value, just click Setting button and change what you want

  2. 🔴🔴 checkout 🔴🔴, before change Setting(config) value, you have to turn off the crawling by clik On toggle button

  3. if you click the user list area, you can see what user chated

  4. you want to do raffle, just clikc Raffle button

    if you click the OK button, message database(collection in mongodb named chat_msg_log) will be initialize
    and save the result (user information) in twitch_raffle_result collection in mongodb
    or if you click the Cancel, nothing happen

detail

  1. you can use mongodb AUTH mode, checkout files below
  • /mongodb/mongodb.conf
  • /crawler/.env
  • /crawler/mongodb.py
  • /app/.env
  • /app/routes/index.js
  • change mongodb values and re-build the image and docker-compose
  1. If you want to change page logo, just change the file below
  • /app/public/images/logo.png
  • This task will be applied in real time by nginx. just refresh page.
  1. you can logs crawler, mongodb, nginx (see docker-compose file's volume)
  • /crawler/logs
  • /mongodb/log
  • /nginx/log

append

  • I used express ejs view engine with vanilla-javascript and ajax(jquery) by signle page index.ejs
  • And I used just on routes index.js. Change every-thing what you want

Tech

  • node(expree), python3(IRC crawling), mongodb, nginx

More About

About

Raffle system with twitch chatting (IRC connection).

License:Apache License 2.0


Languages

Language:JavaScript 91.5%Language:EJS 4.1%Language:Python 3.2%Language:CSS 0.6%Language:Dockerfile 0.3%Language:Shell 0.3%