Skip to content

Instantly share code, notes, and snippets.

View mager's full-sized avatar
🏠
Working from home

Mager mager

🏠
Working from home
View GitHub Profile
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> client.storage.delete_record('com.simplegeo.test', '4')
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> client.storage.get_history('com.simplegeo.test', 'andrew')
>>> 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)
>>> from simplegeo.models import Record, Client
>>> client = Client('your-oauth-token', 'your-oauth-secret')
>>> r = Record('com.simplegeo.test', '4', 37.786521, -122.397850)
>>> 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])
>>> client.context.get_context_by_address("41 Decatur St, San Francisco, CA 94103")
>>> r = Record('com.simplegeo.test', '4', 37.786521, -122.397850,
1262304000, foo='bar')
>>> 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',
{
"query":{
"latitude":40.745717,
"longitude":-73.988121
},
"timestamp":1305242604.074,
"features":[
{
"handle":"SG_3hKU1T8s5du5QuhLmy3629_40.747567_-73.987298",
"name":"36061007600",