summaryrefslogtreecommitdiffstats
path: root/pytrends.py
blob: 479c28549379559ff45453d451ed8b80734ba446 (plain)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/python2
import cjson
import urllib2
from contextlib import closing
url="http://search.twitter.com/trends.json"
with closing(urllib2.urlopen(url)) as ul:
    res = ul.readlines()[0]
    for x in cjson.decode(res)['trends']:
        print x['name'],x['url']