Giter Site home page Giter Site logo

nuung / twitch-chat-raffle Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 2.2 MB

Raffle system with twitch chatting (IRC connection).

License: Apache License 2.0

Python 3.16% JavaScript 91.52% CSS 0.64% EJS 4.14% Shell 0.26% Dockerfile 0.27%
python3 irc raffle twitch twitch-bot twitch-chat chat express javascript node

twitch-chat-raffle's Introduction

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

twitch-chat-raffle's People

Contributors

nuung avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.