This service receives all messages for a specific Twitch channel, and sends them to an Apache Kafka instance. This project was done in sponsorship with Aiven.
You will need to generate a "oauth token" via this service.
You will need a .env
file with the following values defined.
TWITCH_NICKNAME=[nickname for this project]
TWITCH_CHANNEL=#[channel you are looking to read chat messages from]
TWITCH_OAUTH=[oauth token generated by https://twitchapps.com/tmi/]
AIVEN_HOST=[host uri defined by Aiven dashboard]
AIVEN_PORT=[port as defined by Aiven dashboard]
You will also need the ca.pem
, service.cert
, and service.key
files in the main directory, as defined by the Aiven service.
This project uses Python3.
You will need to source the venv
to use this project to get started.
$ python -m venv venv && source venv/bin/activate
$ pip install -r requirements.txt
To run the kafka service:
$ python main.py
Websites I used to learn
- https://github.com/aiven/aiven-examples/blob/main/kafka/python/producer_example.py
- https://www.learndatasci.com/tutorials/how-stream-text-data-twitch-sockets-python/
- https://aiven.io/developer/teach-yourself-apache-kafka-and-python-with-a-jupyter-notebook
- https://dev.twitch.tv/docs/irc/get-started/
- https://dev.twitch.tv/docs/irc/
- https://github.com/MariusPerle/twitch_chat/blob/master/twitch_chat.py