Giter Club home page Giter Club logo

twitter-accounts-analyzer's Introduction

Twitter Accounts Analyzer

This project is a Twitter data analysis tool that fetches tweets from Twitter using the Twitter API, saves the tweets and user data into a local MongoDB database, and then displays the results in a Streamlit app. The tool is specifically designed to analyze Twitter accounts in based on geoloaction.

Project Structure

The project consists of several Python scripts:

  • twitter_api.py: This script contains the TwitterAPI class, which is used to interact with the Twitter API. It fetches tweets based on a query and geolocation, and also fetches the top retweeted tweets of a user. Credentials are fetched from a tokens.csv file located in your root directory.

  • main.py: This script is responsible for fetching the tweets and saving them to the MongoDB database. It also extracts and saves the users to the database.

  • streamlit_app.py: This script is responsible for running the Streamlit app and displaying the results. It loads the data from the database and displays it in the app.

How to Run

  1. Run the main.py script to fetch and save the tweets and users.
python main.py
  1. After the main.py script has finished executing, run the streamlit_app.py script to display the results.
streamlit run streamlit_app.py

Please note that you need to run these commands in the directory where your scripts are located. Also, make sure that you have installed all the necessary packages and that your MongoDB server is running.

Dependencies

This project requires the following Python packages:

  • tweepy: To interact with the Twitter API.
  • pandas: To manipulate and analyze the data.
  • streamlit: To create the web app for displaying the results.
  • pymongo: To interact with the MongoDB database.
  • matplotlib: To create the plots for the data visualization.

You can install these packages with pip:

pip install tweepy pandas streamlit pymongo matplotlib

twitter-accounts-analyzer's People

Contributors

kyrpel avatar

Watchers

 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.