Giter VIP home page Giter VIP logo

python-tweet-streamer's Introduction

STREAMING TWEETS INTO MYSQL DATABASE USING PYTHON

About

This project is focused on streaming live tweets that contains specified keywords, and storing them into a specified MYSQL database for easy access among professionals who have been granted access to the database. The app will as well clean the tweet texts, and obtain the respective sentiment scores & labels before storing the streamed tweets into the specified database

Running the Streaming Job

To run the streamling job, simply clone this repository by running the below command on your terminal:

git clone https://github.com/Behordeun/tweet-streamer.git
cd tweet-streamer

Install the required modules/libraries

pip install -r requirements.txt

Prerequisites

  1. Twitter Developers account (with elevated access)
  2. MySQL Server Installation
  3. MYSQL Workbench (optional)
  4. An IDE of choice (e.g., Microsoft Visual Studio Code, PyCharm, Sublime etc.)
  5. Basic knowledge of SQL
  6. Working knowledge of Python Programming language

Upon the creation of your Twitter Developers account, simply log into your account and create a project so you may be able to generate the needed credentials for accessing the Twitter API (Application Programming Interface) see here for tips on getting started with Twitter Developers account.

Setting up the MYSQL Database

Simply launch your MYSQL Workbench, copy the contents of tweet_db.sql file into a blank SQL tab and execute. This creates a database called tweet_db, and a table (elections) in the tweet_db database.

Starting the Streaming App

After having setup up the neccessary files and services, simply run the below command on your terminal

python app.py

The terminal will then prompt you to enter the list of kweywords you want track (enter each keyword separated by a comma and hit the enter key on your keyboard). Voila, the streaming job should start with ease.

You can confirm that the job is running smoothly by refreshing your database at intervals to see the new tweets being streamed into the database.

NB:

Only twenty (20) data points (attributes) were collected and stored into the database. If you are interested in more features, then you can tweak both the attached SQL file tweet_db.sql and the python file app.py to suit your use case.

For safety purpose: you are not expected to commit your credentials. Hence, it is advised that you add keys.py to the .gitignore file.

Please feel free to fork this repo if you are interested in contributing to the project as I look forward to adding addional features to the app in due time.

If you encounter any issues running the streaming job, please do not hesistate to contact me for further clarity and assitance.

About the Author

Muhammad Abiodun Sulaiman is a data analytics professional with vast experience spread across Data Science and Business Intelligence. He is a Cloud DevOps Engineering enthusiat who is skilled at Infrastructure as Code using tools such as Terraform, Docker, Kubernetes, Ansible, AWS Cloudformation, AWS Cloudwatch, etc.,

He currently works at Tsaron Technologies Limited as a Telematics Data Scientist, and is specialized at building Machine Learning models for Scoring and Classifying drivers into different safety zones based on their driving behaviours.

He can be contacted via the following medium:

  1. Email: [email protected]
  2. LinkedIn:Muhammad Abiodun Sulaiman
  3. Twitter:@Prince_Analyst
  4. Facebook:Muhammad Abiodun Sulaiman
  5. Tel: +(234)810 831 6393

THANK YOU FOR TRYING OUT MY APP

python-tweet-streamer's People

Contributors

behordeun avatar

Stargazers

 avatar

Watchers

James Cloos 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.