I’m stuck with sharing and commenting Facebook posts from my website.
Look.
In Twitter we can reply a tweet simply by a link
https://twitter.com/intent/tweet?in_reply_to=35782000644194304
or
we can retweet the tweet by this link
https://twitter.com/intent/retweet?tweet_id=35782000644194304
it’s so easy, after clicking you redirecting to twitter where you can do this, and i like it.
With facebook posts it is not so easy.
I have Facebook posts (copies of posts, i parsed them before and saved to my DB, ID of that posts I saved too) at my website and I’d like to share/comment/like this posts. Maybe Facebook have the links like twitter, or some another way to do it, I don’t know, but i spend all day to find solution and I failed.
Maybe it is possible to create links like this:
http://facebook.com/ID_OF_THAT_FB_POST/share
or
http://facebook.com/ID_OF_THAT_FB_POST/comment
and.. after clicking the link, it redirects to facebook page, where you can share this post or comment?
Well let me see if I understand, If you want to SHARE/COMMENT/LIKE a post on Facebook, from your website then you can use the Graph API, POST, connection section.
https://developers.facebook.com/docs/reference/api/post/
This allows you to create a comment and a like, having the right access_token and the stream_publish permission.
So you have yo make an HTTP POST request to http://graph.facebook.com/POST_ID/comments?message=HELLO+WORLD&access_token=YOUR_ACCESS_TOKEN
same thing for the like:
make an HTTP POST request to http://graph.facebook.com/POST_ID/likes?access_token=YOUR_ACCESS_TOKEN
with Javascript SDK would be something like this :
If you want to share the there is no API documentation for that, but you can use something like this: