public
Description: A binding for the Fire Eagle API in Python
Homepage:
Clone URL: git://github.com/SteveMarshall/fire-eagle-python-binding.git
100644 31 lines (20 sloc) 0.81 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import fireeagle_api
import os.path
from pprint import pprint
 
"""
 
First, paste your consumer key and secret into ~/.fireeaglerc, in the following format:
 
consumer_key = YNqmPYEMEOzA
consumer_secret = 7W6t7UwHXhe7UtAVo2KO5VGbK6I1UjOS
 
"""
 
fe = fireeagle_api.FireEagle( os.path.expanduser( '~/.fireeaglerc' ) )
 
print "Getting a request token"
request_token = fe.request_token()
 
auth_url = fe.authorize( request_token )
raw_input( 'Please go to the following URL and authorize the token:\n%s\n' % auth_url )
 
print "Exchanging the request token for an access token"
access_token = fe.access_token( request_token )
 
where = 'London, England'
print "Looking up %s" % where
pprint( fe.lookup( access_token, q=where ) )
 
print "Asking Fire Eagle where you are"
pprint( fe.user( access_token ) )