Post picture to Facebook using Python
Asked Answered
E

4

6

How can I post an image to Facebook using Python?

Ebracteate answered 25/2, 2011 at 14:8 Comment(1)
I think this question can help you: #4009941Pet
A
5

You can use the facebook provided Python SDK to upload photos using an oauth key.
Once you get the oauth key, you can upload a picture with GraphAPI.put_object():

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()
Abstruse answered 26/2, 2011 at 10:53 Comment(0)
M
2

Unfortunately, the Python SDK is discontinued now. Will not work. Need to use Javascript / PHP / iOS / Android APIs

Mt answered 28/2, 2012 at 13:10 Comment(0)
B
2

Fresh links of Facebook Platform Python SDK

http://pythonforfacebook.com

Boutwell answered 8/6, 2012 at 3:53 Comment(0)
B
1

Checkout this library: https://github.com/facebook/python-sdk/

Bozo answered 25/2, 2011 at 17:56 Comment(1)
The repo link is no more available, this time right now I check it.Wagonette

© 2022 - 2024 — McMap. All rights reserved.