admin管理员组文章数量:1356838
Ok, so here was my first question: How do I allow visitors on my site to share my photos on their facebook news feed?
After implementing it I realized what I really want is to upload the image as a photo to their photo album.
How would I got about getting an image on my site, to upload to their photo album, when they click on a facebook icon next to the image?
Any thoughts at all are appreciated.
Thank You.
Ok, so here was my first question: How do I allow visitors on my site to share my photos on their facebook news feed?
After implementing it I realized what I really want is to upload the image as a photo to their photo album.
How would I got about getting an image on my site, to upload to their photo album, when they click on a facebook icon next to the image?
Any thoughts at all are appreciated.
Thank You.
Share Improve this question edited Apr 13, 2017 at 12:57 CommunityBot 11 silver badge asked Dec 13, 2010 at 5:48 Greg McNultyGreg McNulty 1,4665 gold badges28 silver badges50 bronze badges 02 Answers
Reset to default 4Register your application at Facebook (create a Facebook app).
Authenticate the user with Facebook, at the same time user approves your app access.
Use Facebook publishing api to upload image (follow link, look for Publishing title).
First make sure that you are authorized to publish to the user's feed with the publish_stream permission.
Then use the api mands to send the photo to the server.
Here's an example using the Branches FB API:
Dim FB As New SessionInfo("[access_token]")
Dim Posts = New Functions.Posts(FB)
Dim img As String = "[Local picture Location]"
Dim F = New IO.FileStream(img, IO.FileMode.Open, IO.FileAccess.Read)
Dim B(F.Length - 1) As Byte
F.Read(B, 0, B.Length)
F.Close()
Dim PhotoID = Posts.PublishPhoto("[Album ID]", "[caption]", true, B, [Optional Tags if any])
Tagging users is similar, just pass in a tag list when you call PublishPhoto
Dim TL As New List(Of Tag)
Dim T As New Tag
T.id = "[userID]"
TL.Add(T)
Dim PhotoID = Posts.PublishPhoto("["me" or Album ID]", "[caption]", true, B, TL)
本文标签: apiHow do I programmatically upload pictures to facebookStack Overflow
版权声明:本文标题:api - How do I programmatically upload pictures to facebook? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744034469a2579509.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论