My page has meta information
og:title
og:category
og:price
Is it possible to display those information when one shares the like on his wall? how? from what I tried on the and the actual url + img are shown in the post:
John recommends Title on MyApp.
thank you
No, there's no way to include key/value pairs in a regular feed post - if you're posting Open Graph actions you can have some properties of the object displayed in the feed stories but this isn't possible when supplying the feed data yourself.
See the Open Graph docs for more info
Related
I'm trying to display various custom post types such as Paper, Publication, Events, Media linked to a person on their profile page.
E.g when we add a Paper/Publications we link single/multiple peoples associated with this paper. The 'people' is a repeater field "linked_author" with "paper_linked_author" as sub-field (post object).
So, people profile will have the following:
- Policy
- Publication
- Media
- Events
How can I do that?
I think you might be thinking about it backwards, if you want to display these linked Post Types on a people page then maybe it's easier to have your custom fields on the People page instead.
I need object comment list with their authors for extraction statistical information about author and their comments. FB Graph api allow me to get comment list but there no way to get information about comment author.
Since v2.11 of the Graph API, you can only get user information about comment authors by using a Page Token. You can only get a Page Token if you manage the Page. There is no way to get the author data if you do not manage the Page.
Changelog: https://developers.facebook.com/docs/graph-api/changelog/version2.11#gapi-90
Also, make sure you ask for the relevant fields: /post-id/comments?fields=message,from
I'm having good luck using python and the FB graph api to collect reactions, comments from Facebook posts however, I'm having trouble targeting this specific photo link:
https://www.facebook.com/SheShopped/photos/a.432191143458704.110954.428340903843728/1367643623246780/?type=3&theater
Can anyone tell me how to deconstruct this link into a FB graph query?
If you want to look at the comments of this specific photo you just need to extract the id from the link (it's the last segment of the url) which is 1367643623246780. You'll find the comments at 1367643623246780/comments:
If you want to find this picture and others like it, you need to notice the type of picture (it is a 'Timeline Photo'). Looking at the relevant API-Documentation (Open Graph Page Photos) these can be found at 'SheShopped/photos/uploaded':
Is there anyway to determine if an object in Open Graph has been liked?
The documentation seem to imply that I have to post a like action on my object and expect an Error 3501 when it has been liked before.
From an UI pov this doesn't make sense, I want to change my like button ui to an "unlike" state without having to like my object and see if it fails or not.
Thanks!
If you're looking specifically for likes on an Open Graph Object (as in the target of an Open Graph Action), and you're talking about built-in (og.likes) likes, Shawn's answer is mostly right, but you need to look in a different FQL table.
An Open Graph Object is just a URL that resolves to a page that has og:type meta in its header. Facebook treats these as link objects (you can check this with SELECT type FROM object_url where url='http://url.to/your/object')
You can find interesting information in the link and link_stat FQL tables, but what you're looking for is the join table where Facebook relates user likes to links: the url_likes table.
So, to tell if the current user has liked a given Open Graph Object, you'd use:
SELECT user_id FROM url_like WHERE user_id=me() AND url='http://url.to/your/object'
If you get a value back, the current user has already liked it. If you get an empty array, the current user has not liked it.
To my knowledge, there's no way to do this with the Graph API, only FQL. I'd love to be proven wrong, though.
Depending on the object, if the object has a like connection you can user the graph api to determain if current user has liked the object.
i use fql in a similar fasion to check if a user likes a post.
/fql?q=SELECT+user_id+FROM+like+WHERE+post_id=\''.$postid.'\'+AND+user_id=me()
refer to post / like https://developers.facebook.com/docs/reference/api/page/
I'm starting to use the Graph API to get my notifications, and in the REST interface, they had the object_id field. I used this to get the notification objects' id to then query the Graph for more information.
The Graph API object does not include this information.
Example of what I want to do:
Get user's notifications JSON object.
Grab single item
Identify if this item supports commenting/liking
Display comments and number of likes for that item
if user can comment or like item, display buttons for this
my process:
call me/notifications/?include_read=1
is pretty easy to do.
I can identify if the object refers to a group, event, random application, post, or photo using the URL. I know that posts, likes, photos and others support commenting/likes so I have a way of doing this, though it involves parsing the link attribute of the item
this is what I need help with. I can get the id of the object by parsing the link, but I don't get the full object some times using this. For example, to post on a comment, you need to have USERID_COMMENTID and the link only has the COMMENTID in this form http://www.facebook.com/USERNICKNAME/posts/COMMENTID
I also need help with this. I guess some fb objects can't been liked via the graph?
any help would be great!
The notification FQL table, which also replaced the REST notifications.get API, still has an object_id column. That's the closest thing that exists to what you're asking for. It doesn't look like the Graph API call is documented to have the object_id field unfortunately.