Skip to content

Instantly share code, notes, and snippets.

@ayakix
Last active December 17, 2015 00:59
Show Gist options
  • Save ayakix/5524864 to your computer and use it in GitHub Desktop.
Save ayakix/5524864 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
try:
import simplejson as json
except ImportError:
import json
URL = "http://search.twitter.com/search.json"
def getCount(url):
res = urllib2.urlopen(url)
jsonStr = json.loads(res.read())
results = jsonStr['results']
if 'next_page' in jsonStr:
return len(results) + getCount(URL + jsonStr['next_page'])
return len(results)
def main():
words = ["discos","mearth","moonsettlergame","asteroidtriangulation","NASAinourhouse","perpetuality","whereonmarble","anapneo","popeyeonmars","curiosityroverblog","spotstationaut","spacecadetapp","greenhouseapp","openspacemap","moonroverapp","LEGOexplorers","astex","cubeworld","marsmet","discovery3dapp","juegocuriosity","road2stars","bigmarbleapp","cosmicsays","familyplanningapp","culichisrover","viveroapp","arduhack","webroverapp","cupolarider","greatexplorerapp","NASAgreenercities","starhopperapp","terrafarmingapp","creatorsproject","syncspaceapp","spottheissapp","instamars","mentorapp","lebluemarvel","energyexplorerapp","spacetrekapp","openTEC","solapp","stellarstuffapp","karkhanarover","curiousinnepal","DIGS","spaceviewapp","redtogreen","safariapophis","rendezvousgame","spaceappsrocket","asteroidocculator","xspacious","marssense","enermap","projectsoil","teeminus10","fallingstarfinder","greenhousemonitor","energy2people","lamotherearthapp","whyweexploreapp","ispotitapp","boke","catchameteor","adruinopiapp","MexiLEGO","aquaping","promeapp","willireachapp","mapgapapp","spacecalnyc","tinyseabots","discoverymarsapp","OKtomars","wafatetomars","NXTapps","issbasestationapp","earthkamapp","Twistoric","PicStoria","spacedecode","neovizapp","skyviewapp","hellocuriosityapp","commandROV","MS3P%20","SpaceHub","greenonredapp","spacecalapp","leapROV","skylogneowsapp","starsinthecloudapp","ariss","compassstation","LEGOrobot","SpotApp","inventaRD","sismoapp","LEGOrover","angryplanets","forecastapp","ardusat2earth","chicksbook","ghostapp","leapforEuropa","opentiles","launchpadmoon","Meteorienteer","spaceveggies","personalcosmos","cloudlessspots","auroralocalization","intergalacticspecies","POMproject","myearthapp","watchtowerapp","waystationapp","inboundapp","asterank","livingonmarsapp","arduImuv4","OTGYork","teamcentauri"]
dic = {}
for word in words:
dic[word] = getCount(URL + "?q=%23" + word + "%20spaceapps&rpp=100")
for k, v in sorted(dic.items(), key=lambda x:x[1], reverse=True):
print k + "\t" + str(v)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment