Add image to Facebook using Python

How to send image to Facebook using Python?

+5
source share
4 answers

You can use the facebook provided by the Python SDK to upload photos using the oauth key.
Once you get the oauth key, you can load the GraphAPI.put_object () image :

graph = facebook.GraphAPI(oauth_access_token)
photo = open("picture.jpg", "rb")
graph.put_object("me", "photos", message="You can put a caption here", source=photo.read())
photo.close()
+4
source

Unfortunately, the Python SDK is now discontinued. Will not work. You must use the Javascript / PHP / iOS / Android API.

+2
source

All Articles