Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Andrew Mager mager

🏠
Working from home
Block or report user

Report or block mager

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View simplegeo-com.python.nearby.py
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> client.storage.get_nearby('com.simplegeo.global.flickr', 37.765850, -122.437094, limit=1, radius=0.5)
View simplegeo-com.python.record_history.py
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> client.storage.get_history('com.simplegeo.test', 'andrew')
View simplegeo-com.python.delete.py
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> client.storage.delete_record('com.simplegeo.test', '4')
View simplegeo-com.python.batch.py
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> r1 = Record('com.simplegeo.test', '7', 37.786521, -122.397850, \
'place', 1262304000, name = 'Chatz Coffee')
>>> r2 = Record('com.simplegeo.test', '8', 37.786274, -122.397513, \
'place', 1262304000, name = 'CBS Interactive')
>>> client.storage.add_records('com.simplegeo.test', [r1,r2])
View simplegeo-com.python.add_record1.py
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> r = Record('com.simplegeo.test', '4', 37.786521, -122.397850)
View simplegeo-context-python2.py
>>> client.context.get_context_by_address("41 Decatur St, San Francisco, CA 94103")
View simplegeo-com.python.add_record3.py
>>> r = Record('com.simplegeo.test', '4', 37.786521, -122.397850,
1262304000, foo='bar')
View simplegeo-python-annotations.py
>>> import simplegeo
>>> client = simplegeo.Client('your-oauth-token', 'your-oauth-secret')
>>> handle = 'SG_3ckjlXmAXOR2XjpuJQ0p7E' # India
>>> annotations = {
... 'country_codes':
... {
... 'alpha-2': 'IN',
... 'alpha-3': 'IND',
... 'numeric': '356',
View simplegeo-context-response.json
{
"query":{
"latitude":40.745717,
"longitude":-73.988121
},
"timestamp":1305242604.074,
"features":[
{
"handle":"SG_3hKU1T8s5du5QuhLmy3629_40.747567_-73.987298",
"name":"36061007600",
You can’t perform that action at this time.