How to “Like” facebook content externally

前端 未结 5 1973
清酒与你
清酒与你 2021-02-15 15:00

So I have been playing around with the facebook like button but I have run into a problem. I have a facebook page about some charity work I\'m doing here:

http://www.fac

5条回答
  •  萌比男神i
    2021-02-15 15:29

    I'd like to point out that this is a very messy mash-up of ideas to go about this, and not a complete solution. I would advise to sit down and crack your head open on the Facebook Docs for a little while.

    Please look here. As you can see, every object in facebook, is part of the Graph API. As such, it has it's own unique ID an properties. As per photos, you can look here and see that each photo has it's own unique id.

    So-what you need to do, is call that specific photo from that specific album from that specific page each time your web page is loaded, and as such, you will be able to pull all the comments and likes this photo received on Facebook.

    I'd say the best way to go about this is to initialize the JavaScript SDK, perform an FQL query on the specific picture you want, and get the data.

    Now-as per displaying: Since facebook does not have a special plugin to show photos on external web pages, the display part is the tricky part. All the info is received in a JSON object, which you can display in any way you want. I would suggest, to make the experience more social, creating a like button for each photo with the id of that photo in the Graph API. Docs are here.

提交回复
热议问题