Objectives
Make streaming processing using Kafka basic components that consume/subscribe data from the Twitter API. The twitter data used is up to students, feel free to explore.
Requirements
- Python 3
- Docker
- IDE (VSCode, Intellij, etc)
- Terminal
- Python libraries
pip install confluent-kafka
pip install tweepy
- Twitter Developer account (https://developer.twitter.com/en/portal/petition/essential/basic-info)
How to Run
- Setup your Twitter Developer account to the Elevated level
- Open your app project on Twitter Developer portal and copy the Bearer Token
- Paste the Bearer Token to kafka_producer.py (line 23)
- Change the "search term" to your choice (line 26)
- Activate Docker, open terminal, and write
docker-compose build
docker-compose up
- Open new terminal and write
python3 kafka_producer.py
- Open new terminal and write
python3 kafka_consumer.py