DIGIT-ARC read-only archive · snapshot: July 23, 2026

Google Search Trends of Indian Politics

5 posts · originally from https://geek.digit.in/community/threads/google-search-trends-of-indian-politics.184911/

@
@vi Original post #1
Jun 25, 2014 at 4:33 PM
*i.imgur.com/51zmXqU.png​

site: Google Search Trends of Indian Politics
source code: *github.com/avinassh/polistats

What it is and How it works:

These two following graphs show the number of search results appeared on Google for certain keywords. If you search for 'Narendra Modi ' today you will see approximately 15 million search results. The graphs here show exactly that from May 4, 2014. I just wanted to compare the number search results for Narendra Modi, Arvind Kejriwal and Rahul Gandhi. These graphs also include search results for Sonia Gandhi, BJP, AAP and Congress India. One graph shows number of search results on main Google search site and other on Google News.

I wrote a bot which visits Google four times a day at 10am, 2pm, 6pm and 10pm. It searches for the keywords on both sites and stores the results in database. The bot is active since May 4, 2014. Bot is written in Python and MongoDB is used to store the data. An API end point is available to get all the data in JSON and it is powered by Tornado.

If you want to run on your own, installation instructions here:

1. Install required libraries from requirement.txt:

Code:
pip -r install requirements.txt

2. Run bot.py to start collecting data. If you want run the bot multiple times a day, use crontab:

Code:
$crontab -e
00 10,14,18,22 * * * /home/johnappleseed/polistats/bot.py

3. Run server.py to provide API end point
Anorion
Anorion #2
Jun 25, 2014 at 5:01 PM
cant see graph on main site
is there an index for those lines? like what each line stands for, donno how to read graph
would be great if it can co-relate with news from that time
@
@vi #3
Jun 25, 2014 at 5:12 PM
^Graph is working fine here...can you try again by refreshing the page?

would be great if it can co-relate with news from that time
yeah! good idea... I will see how to do that...
Anorion
Anorion #4
Jun 25, 2014 at 5:25 PM
wow. its working fine. took some seconds to load.
its really good, just wish it had been for more months from the past too
@
@vi #5
Jun 25, 2014 at 5:32 PM
^thank you!

yes it takes time to load as whole bunch of data is being thrown at once. I will looking at the ways to avoid it... I got this idea before election results, but yeah would have been better if I had more data.