1. Mariusz Kryński
  2. filmaster-api-sample


this directory contains few Filmaster API samples:

* common_recs - simple pure js sample - anonmouse requests with jsonp output format, to run simply point your browser to common_recs/index.html
* fbapp.py - simple Facebook application, using our OAuth extension for authenticating Facebook users (for Google AppEngine platform)
* apiexplorer.py - simple webapp using standard OAuth authorization (GAE), for easy API exploring
* test_client.py - command line API client, for testing OAuth authentication

fbapp.py are apiexplorer.py are designed to run on Google AppEngine platform - visit https://developers.google.com/appengine/docs/python/gettingstartedpython27/devenvironment to learn how to run they locally or deploy to GAE servers. 

Quick start guide:
* generate your key / secret at: http://filmaster.com/settings/application
* create settings.py using settings.py.template, providing required Filmaster and Facebook app credentials
* run google_appengine/dev_appserver.py filmaster-api-sample
* point your browser to http://localhost:8080/api-explorer/ or http://localhost/fbapp/

These examples are deployed already here:
* http://filmaster-tools.appspot.com/api-explorer/
* http://filmaster-tools.appspot.com/fbapp/
* http://filmaster-tools.appspot.com/common-recs/index.html

test_client.py usage:

$ python test_client.py --help

Usage: test_client.py [options] key secret

  -h, --help            show this help message and exit
  -t ACCESS_TOKEN, --access-token=ACCESS_TOKEN
                        OAuth access token
  -c CALLBACK_URL, --callback-url=CALLBACK_URL
                        OAuth callback url
  -f FB_ACCESS_TOKEN, --fb-access-token=FB_ACCESS_TOKEN
                        Facebook access token, for login/auto-create users
                        associated with fb account
  -v, --verbose         Verbose

to test standard OAuth run:
$ python test_client.py filmaster_app_key filmaster_app_secret -c http://fake_callback/

to test our OAuth extension for authenticating Facebook users run:
$ python test_client.py filmaster_app_key filmaster_app_secret -f facebook_access_token

If you have filmaster oauth access_token already (it is displayed by above commands) you may authenticate usint it - run:
$ python test_client.py filmaster_app_key filmaster_app_secret -t filmaster_access_token

All python examples use filmaster_auth.FilmasterOAuthClient class implementing simple API client, (filmaster_auth.py file contains short documentation)