using the graph api me/albums method, I get two "Wall Photos" album entries.. with different types (normal, wall)
My understanding is: "wall" is used to store the wall photo posts and "normal" to store the photos posted in a friend's wall..
Question: Why is the type normal? shouldn't be something different to understand the album has not been actually created by the user? like other automatically created albums.. (profile, mobile, wall)
Every posts on the "normal" Wall Photos album are not really visible, because the album is not accessible from the UI.. so I need a way to filter this album out from the list of usable albums, but I would rather find a better way instead of verifying the name of the album..
Thanks in advance.
Related
In order to get a list of likes I need to provide an object-id. If I provide my profile I will only get a list of the pages I liked. I currently
Graph = facebook.GraphAPI(access_token=token, version="3.0")
profile = graph.get_object('me')
posts = graph.get_connections("me", "likes")
print(len(posts['data']))
This currently returns 1, which is correct because I just like 1 page.
But I would like to get a list of all the thousands of likes I placed in specific posts, photos, videos, etc.
I would also like to get a list of all the Events which I didn't create but was invited to.
I can't seem to find a way to do these things. I've gone through the whole roll of possible things I can gather from my profile and none seems to return what I want. The most promising one was "objects" but I can't seem to get anything out of it.
Please help.
Thanks in advance,
Nuno
I want to make a request to search for 'customized' things, like: Restaurants nearby (see screenshot here)..
Another example is: Music my friends like, in the Graph API explorer, if I query music, I just get what I like, not my friends'. Any tip? tks.
me/friends?fields=music
will give you the music interests of your friends
and for nearby restaurants you will have to execute a complex query like
search?q=cafe&type=place¢er=37.76,-122.427&distance=1000
Refer to this page for search types
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/
By querying fbid/likes i can get the fbid and names of all of the users who likes an object. However, when me myself likes the object, i represent a page, and therefore my "like" isn't presented as me, but as the page. How can i determine if the user likes an object or not?
After some more research i found that i simply can't. The best way is to query the Graph for the users who like the object, and then compare that to the user id and see if the user id exists in the result
We have a wedding photography site that I am adding the Facebook Like button to the individual image pages. Regarding Facebook and the og:title tag, is there a downside if the og:title tag is the same for each image in the gallery? Example: "John and Jane's Wedding" Or should it be "John and Jane's Wedding - image1.jpg"? I just want to make sure that if someone likes multiple images from the one gallery, that Facebook will treat each like correctly if the same title is used for each one, or do they each need to be unique? Image file names are not always pretty, such as img000014.jpg, so I would like to avoid using them if it is ok.
It may be confusing to users that different content (images in your case) have same title, but from technical perspective there is nothing wrong with it.
As long as those images have different URL's they be treated as different objects to Facebook OpenGraph (since objects are identified by URL's not titles).