https://github.com/chimeracoder/pysq-dev
Python wrapper for Foursquare
https://github.com/chimeracoder/pysq-dev
Last synced: 5 months ago
JSON representation
Python wrapper for Foursquare
- Host: GitHub
- URL: https://github.com/chimeracoder/pysq-dev
- Owner: ChimeraCoder
- Created: 2011-06-22T23:02:10.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-07-12T05:08:36.000Z (over 14 years ago)
- Last Synced: 2025-03-23T07:14:28.791Z (11 months ago)
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pysq
=========
Introduction
-------------
Pysq is an unofficial wrapper for version 2 of the Foursquare API. It was developed on Python 2.7 on a Linux machine, though it should work on Python 2.6 and on other platforms.
Use
-----------
Pysq provides a wrapper for authentication through OAuth. First, register your application on the Foursquare developer homepage to receive your client_id and client_secret values. Then, authenticate using the FSAuthenticator class. (Note that redirect_uri is the uri for your application, which you register with Foursquare).
> authenticator = FSAuthenticator(client_id, client_secret, redirect_uri)
Then, redirect your user to the uri that the FSAuthenticator object generates:
> uri = authenticator.authorize_uri()
The user will sign in with his/her Foursquare credentials, and Foursquare will redirect back to your registered page (redirect_uri), with a code passed as a GET parameter. Retrieve this code and pass it in to the set_token method:
> authenticator.set_token(code)
You are now ready to begin making queries that this user is authorized to make!
Querying Users
--------------
To obtain a User object, use the UserFinder object.
> finder = UserFinder(authenticator)
> my_user = finder.findUser(id)