Skip to content

Instantly share code, notes, and snippets.

@reddragon
reddragon / get_data.py
Last active February 20, 2017 09:53
Getting Lat/Long Coordinates of my Twitter friends' locations
import urllib
import simplejson as json
def get_followers_url(handle):
return 'https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=' + handle
def get_followers(handle):
return json.load(urllib.urlopen(get_followers_url(handle)))['ids']
def get_friends_url(handle):