Skip to content

Commit 58beb3c

Browse files
committed
Convert readme to ReStructuredText.
1 parent fa58e33 commit 58beb3c

File tree

4 files changed

+57
-46
lines changed

4 files changed

+57
-46
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
include readme.md
1+
include README.rst
22
recursive-include examples *.css *.html *.ico *.py *.sql *.txt *.yaml

README.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
===================
2+
Facebook Python SDK
3+
===================
4+
5+
This client library is designed to support the `Facebook Graph API`_ and the
6+
official `Facebook JavaScript SDK`_, which is the canonical way to implement
7+
Facebook authentication. You can read more about the Graph API by accessing its
8+
`official documentation`_.
9+
10+
.. _Facebook Graph API: https://developers.facebook.com/docs/reference/api/
11+
.. _Facebook JavaScript SDK: https://developers.facebook.com/docs/reference/javascript/
12+
.. _official documentation: https://developers.facebook.com/docs/reference/api/
13+
14+
Basic usage:
15+
16+
::
17+
18+
graph = facebook.GraphAPI(oauth_access_token)
19+
profile = graph.get_object("me")
20+
friends = graph.get_connections("me", "friends")
21+
graph.put_object("me", "feed", message="I am writing on my wall!")
22+
23+
Photo uploads:
24+
25+
::
26+
27+
graph = facebook.GraphAPI(oauth_access_token)
28+
tags = json.dumps([{'x':50, 'y':50, tag_uid:12345}, {'x':10, 'y':60, tag_text:'a turtle'}])
29+
graph.put_photo(open('img.jpg'), 'Look at this cool photo!', album_id_or_None, tags=tags)
30+
31+
If you are using the module within a web application with the JavaScript SDK,
32+
you can also use the module to use Facebook for login, parsing the cookie set
33+
by the JavaScript SDK for logged in users. For example, in Google AppEngine,
34+
you could get the profile of the logged in user with:
35+
36+
::
37+
38+
user = facebook.get_user_from_cookie(self.request.cookies, key, secret)
39+
if user:
40+
graph = facebook.GraphAPI(user["access_token"])
41+
profile = graph.get_object("me")
42+
friends = graph.get_connections("me", "friends")
43+
44+
45+
You can see a full AppEngine example application in examples/appengine.
46+
47+
Reporting Issues
48+
================
49+
50+
If you have bugs or other issues specifically pertaining to this library, file
51+
them `here`_. Bugs with the Graph API should be filed on `Facebook's
52+
bugtracker`_.
53+
54+
.. _here: https://github.com/pythonforfacebook/facebook-sdk/issues
55+
.. _Facebook's bugtracker: https://developers.facebook.com/bugs/

readme.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def read(fname):
1818
py_modules=[
1919
'facebook',
2020
],
21-
long_description=read("readme.md"),
21+
long_description=read("README.rst"),
2222
classifiers=[
2323
'License :: OSI Approved :: Apache Software License',
2424
],

0 commit comments

Comments
 (0)