Skip to content

Instantly share code, notes, and snippets.

@mhulse
mhulse / helpers.py
Created June 15, 2011 19:34
Django (1.3) Google Maps v3 Geocoder service lookup example
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# http://djangosnippets.org/snippets/293/
# http://code.google.com/p/gmaps-samples/source/browse/trunk/geocoder/python/SimpleParser.py?r=2476
# http://stackoverflow.com/questions/2846321/best-and-simple-way-to-handle-json-in-django
# http://djangosnippets.org/snippets/2399/
@gpiancastelli
gpiancastelli / goodreads-oauth-example.py
Created August 19, 2010 13:50
A Python example of how to use OAuth on GoodReads
import oauth2 as oauth
import urlparse
url = 'http://www.goodreads.com'
request_token_url = '%s/oauth/request_token/' % url
authorize_url = '%s/oauth/authorize/' % url
access_token_url = '%s/oauth/access_token/' % url
consumer = oauth.Consumer(key='Your-GoodReads-Key',
secret='Your-GoodReads-Secret')