2010-07-20 107 views

回答

1

好的,我想通了。相反,我用這個:http://github.com/wiseman/foursquare-python/tree/16138f7be20ec9ab6b58315dad9ee9765e73bb84

我已經手頭上user_key和user_secret,所以這只是一個幾行件事:

import foursquare 
import oauth 
credentials = foursquare.OAuthCredentials(consumer_key, consumer_secret) 
fs = foursquare.Foursquare(credentials) 
user_token = oauth.OAuthToken(user_key, user_secret) 
credentials.set_access_token(user_token) 
print fs.user() 
1

我創建了關於如何做一個簡單的例子這在使用Google App Engine時是如此。 (https://github.com/muanis/foursquare-oauth-bootstrap)基本上你需要Google oAuth2客戶端(http://code.google.com/p/google-api-python-client/)和httplib2(http: //code.google.com/p/httplib2/)