Skip to content

Instantly share code, notes, and snippets.

@janosgyerik
Created June 10, 2012 19:05
Show Gist options
  • Save janosgyerik/2906942 to your computer and use it in GitHub Desktop.
Save janosgyerik/2906942 to your computer and use it in GitHub Desktop.
Dump foursquare categories to a file in JSON format
#!/usr/bin/env python
#
# Notes:
#
# - python API home:
# https://github.com/mLewisLogic/foursquare
#
# - foursquare API home:
# https://developer.foursquare.com/
#
import foursquare
from django.utils import simplejson as json
# obtained from foursquare API home by registering a client
client_id = 'your_client_id'
client_secret = 'your_client_secret'
client = foursquare.Foursquare(client_id=client_id, client_secret=client_secret)
out = open('foursquare-categories.json', 'w')
out.write(json.dumps(client.venues.categories(), sort_keys=True, indent=4))
out.close()
@alvincyh
Copy link

Neat script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment