Git Product home page Git Product logo

social-media-data-dashboard's Introduction

Social Media Data Dashboard

A dynamic dashboard for fetching public social media data and displaying related stats

Usage

The dashboard user interface:

Features:

The dashboard is divided into two main parts: the sidebar on the left and the main dashboard area on the right.

  • Use the sidebar on the left to choose a platform and mode using the Choose a platform and Choose a mode dropdowns provided there.
    Definitions:
    • Platform: The social media platform to get data from (Facebook or Twitter)
    • Mode: The account from which to get this data
  • On the main dashboard area:
    • Use the Start date and End date input fields to choose the date range for which to fetch and view posts. The number of posts fetched and accounts from which they are fetched will be displayed.
    • Use the dropdowns to view statistics and graphs for the given date range.

About the dashboard

This dashboard is built in Python using the following tools and resources:

Project set up

  • Clone the project: git clone https://github.com/SunbirdAI/social-media-data-dashboard.git
  • Create a virtual environment: python3 -m virtualenv venv
  • Activate the virtual environment: source venv/bin/activate
  • Install project dependencies: pip install -r requirements.txt
  • Create an environment file (.env) and add environment variables as shown in the .env.example file (more detail on the Environment Variables section below)
  • Run the project: streamlit run dashboard.py

Environment variables

The environment variables added to the .env file are used to determine which account you will be fetching data from and which API key you will be using to fetch this data.

Facebook (CrowdTangle) environment variables

Data from Facebook is fetched through the CrowdTangle API. Below are the environment variables used:

Variable How it is used
CROWDTANGLE_API_TOKEN The API token from CrowdTangle that allows you to fetch data from their API
CROWDTANGLE_MODE_LIST_ID The id of the CrowdTangle list from which the posts will be fetched. Insert your mode to the MODE section, based on the definition of Mode above.
CROWDTANGLE_POSTS_URL The url for fetching posts. It is currently https://api.crowdtangle.com/posts

Twitter environment variables

Variable How it is used
DATABASE_URL The url to a PostgreSQL database for storing tweets

Modes

To change modes or add your own modes to the dashboard, go to constants.py in the project root folder and update the MODES and TITLE_TO_MODE dictionaries. As a special case for Facebook posts, update the FB_TITLE_TO_MODE dictionary. Make sure that for each added mode, there is an environment variable in the .env file in the form CROWDTANGLE_*MODE*_LIST_ID as was explained above in Facebook (CrowdTangle) environment variables.

social-media-data-dashboard's People

Contributors

nlsanyu avatar cmplx-xyttmt 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.