├── test ├── __init__.py └── test_facebook.py ├── examples ├── newsfeed │ ├── static │ │ ├── robots.txt │ │ ├── favicon.ico │ │ └── base.css │ ├── app.yaml │ ├── templates │ │ ├── index.html │ │ ├── base.html │ │ └── home.html │ └── facebookclient.py ├── flask │ ├── run.py │ ├── app │ │ ├── __init__.py │ │ ├── templates │ │ │ ├── login.html │ │ │ ├── index.html │ │ │ └── base.html │ │ ├── static │ │ │ └── css │ │ │ │ └── style.css │ │ ├── models.py │ │ └── views.py │ ├── requirements.txt │ └── config.py ├── oauth │ ├── app.yaml │ ├── oauth.html │ └── facebookoauth.py ├── appengine │ ├── app.yaml │ ├── example.html │ └── example.py ├── tornado │ ├── schema.sql │ ├── example.html │ └── example.py └── get_posts.py ├── MANIFEST.in ├── CONTRIBUTING.rst ├── .travis.yml ├── .gitignore ├── docs ├── install.rst ├── index.rst ├── support.rst ├── make.bat ├── Makefile ├── api.rst └── conf.py ├── facebook ├── version.py └── __init__.py ├── setup.py └── README.rst /test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/newsfeed/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | recursive-include examples *.css *.html *.ico *.py *.sql *.txt *.yaml 3 | -------------------------------------------------------------------------------- /examples/newsfeed/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vertelab/facebook-sdk/master/examples/newsfeed/static/favicon.ico -------------------------------------------------------------------------------- /examples/flask/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from os import environ 3 | 4 | from app import app, db 5 | 6 | db.create_all() 7 | app.run(host='0.0.0.0', port=8000) 8 | -------------------------------------------------------------------------------- /examples/oauth/app.yaml: -------------------------------------------------------------------------------- 1 | application: facebook-example 2 | version: 1 3 | runtime: python 4 | api_version: 1 5 | 6 | handlers: 7 | - url: /.* 8 | script: facebookoauth.py 9 | -------------------------------------------------------------------------------- /examples/flask/app/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask.ext.sqlalchemy import SQLAlchemy 3 | 4 | app = Flask(__name__) 5 | app.config.from_object('config') 6 | db = SQLAlchemy(app) 7 | 8 | from app import views, models 9 | -------------------------------------------------------------------------------- /examples/appengine/app.yaml: -------------------------------------------------------------------------------- 1 | application: facebook-example-py27 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: true 6 | 7 | handlers: 8 | - url: /.* 9 | script: example.app 10 | 11 | libraries: 12 | - name: jinja2 13 | version: latest 14 | -------------------------------------------------------------------------------- /examples/flask/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.10.1 2 | Flask-SQLAlchemy==1.0 3 | Jinja2==2.7.2 4 | MarkupSafe==0.19 5 | SQLAlchemy==0.9.4 6 | Werkzeug==0.9.4 7 | argparse==1.2.1 8 | distribute==0.6.24 9 | facebook-sdk==0.4.0 10 | itsdangerous==0.24 11 | requests==2.2.1 12 | wsgiref==0.1.2 13 | -------------------------------------------------------------------------------- /examples/flask/app/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 |
This application is a simple Facebook client. It shows you your News Feed and enables you to post status messages back to your profile. It is designed to demonstrate the use of the Facebook Graph API, the core part of the Facebook Platform. To get started, log in to Facebook below:
5 |You can download the source code to this application on GitHub.
7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /examples/oauth/oauth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |You are logged in as {{ current_user.name|escape }}
11 | 12 | {% else %} 13 |You are not yet logged into this site
14 | 15 | {% endif %} 16 | 17 | 18 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from setuptools import setup 3 | 4 | exec(open("facebook/version.py").read()) 5 | 6 | setup( 7 | name='facebook-sdk', 8 | version=__version__, 9 | description='This client library is designed to support the Facebook ' 10 | 'Graph API and the official Facebook JavaScript SDK, which ' 11 | 'is the canonical way to implement Facebook authentication.', 12 | author='Facebook', 13 | maintainer='Martey Dodoo', 14 | maintainer_email='facebook-sdk@marteydodoo.com', 15 | url='https://github.com/pythonforfacebook/facebook-sdk', 16 | license='Apache', 17 | packages=["facebook"], 18 | long_description=open("README.rst").read(), 19 | classifiers=[ 20 | 'License :: OSI Approved :: Apache Software License', 21 | 'Programming Language :: Python :: 2.6', 22 | 'Programming Language :: Python :: 2.7', 23 | 'Programming Language :: Python :: 3.3', 24 | ], 25 | install_requires=[ 26 | 'requests', 27 | ], 28 | ) 29 | -------------------------------------------------------------------------------- /examples/tornado/schema.sql: -------------------------------------------------------------------------------- 1 | -- Copyright 2010 Facebook 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); you may 4 | -- not use this file except in compliance with the License. You may obtain 5 | -- a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | -- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | -- License for the specific language governing permissions and limitations 13 | -- under the License. 14 | 15 | -- To create the database: 16 | -- CREATE DATABASE example; 17 | -- GRANT ALL PRIVILEGES ON example.* TO 'example'@'localhost' IDENTIFIED BY 'example'; 18 | -- 19 | -- To reload the tables: 20 | -- mysql --user=example --password=example --database=example < schema.sql 21 | 22 | SET SESSION storage_engine = "InnoDB"; 23 | SET SESSION time_zone = "+0:00"; 24 | ALTER DATABASE CHARACTER SET "utf8"; 25 | 26 | DROP TABLE IF EXISTS users; 27 | CREATE TABLE users ( 28 | id VARCHAR(25) NOT NULL PRIMARY KEY, 29 | name VARCHAR(256) NOT NULL, 30 | profile_url VARCHAR(512) NOT NULL, 31 | access_token VARCHAR(512) NOT NULL, 32 | updated TIMESTAMP NOT NULL 33 | ); 34 | -------------------------------------------------------------------------------- /examples/tornado/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Hello, {{ escape(current_user.name) }}
13 | {% end %} 14 | 15 | 16 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/get_posts.py: -------------------------------------------------------------------------------- 1 | """ 2 | A simple example script to get all posts on a user's timeline. 3 | Originally created by Mitchell Stewart. 4 |Hello, {{ current_user.name|escape }}
13 | {% endif %} 14 | 15 | 16 | 17 | {% if current_user %} 18 |