Skip to content
An application which displays India's region wise twitter sentiment on the map.
JavaScript Python Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

How's India Feeling?

An application which displays India's region wise twitter sentiment on the map.

Site screenshot

How to run?


  1. git clone


  1. In the backend folder create a new file

  2. In paste the following code with your twitter api credentials:

    consumer_key = 'YOUR KEY'
    consumer_secret = 'YOUR SECRECT'
    access_token = 'YOUR TOKEN'
    access_token_secret = 'YOUR TOKEN SECRET'

Latest data

  1. cd into backend
  2. Run python3

This will fetch the latest data from Twitter API. contains the logic of fetching tweets.

Run Server

  1. Inside backend run python

Note down the url of your local server

Set API Endpoint

  1. In root directory, in index.js:

    Set api_url = 'YOUR LOCAL SERVER'

    (It's most likely going to be at


  1. Open index.html in a browser

Tweet Fetching

The idea was to show the sentiment of each particular area. So, far it only fetches tweets state wise.

Since Twitter doesn't allow a geometry parameter to filter tweets, we are using points and radius filter of twitter api. The mapping is stored in

Twitter limit

Since there's a limit on the number of tweets we can fetch, only a few number of tweets are fetched per 15 minutes. The is required to added as cron job which is to be run every 15 minutes.

Also, the number of tweets fetched per state is not same, rather's proportional to the state's population density.

Mapping Visualized

State Mapping

Next step would be to replace this logic with something which is more correct. One possible solution is to fill each area with smaller circles and use these circles. This is a good starting point.


  1. Improve UI
  2. Improve mapping logic
  3. Create Logic for smaller areas
  4. Make a better todo list

Contributions are welcome!

You can’t perform that action at this time.