How can I get all the URLs (outside of Facebook) a Facebook user liked via a Like button embedded in an external site? - facebook

I tried several options:
https://graph.facebook.com/me/likes ,
https://graph.facebook.com/me/links
and a couple of FQL queries - but none returned Likes a user makes via Like buttons on external sites.
Any ideas?

You just take the Extended Permission of user_likes, you will get what you are looking for....

I think that user_likes only give you the permission to see all real objects that the user likes:
a movie,a musician...
if a page is tagged as article for example:
it won't be shown in the likes request
https://graph.facebook.com/me/likes
cause there is no object in the social graph for it:
"Note that the Open Graph protocol is currently designed to support real-life objects. If your URL is a piece of content — such as a news article, photo, video, or similar — you should set og:type to article (see below). Pages of type article do not have publishing rights, and will not show up on user's profiles because they are not real world objects."
(http://developers.facebook.com/docs/opengraph/)
I am also looking for the same api request, I'll let you know if I'll find it...
Editing:
Ok I asked this question on Facebook:
http://forum.developers.facebook.net/viewtopic.php?id=94745
and there is no way of doing that.

Related

Automatically find public posts and comments on Facebook and unlike/remove them?

I'm using Facebook for many years, and I've liked and commented a lot of friends posts (status, photos, etc). The problem is that I didn't pay attention to that these posts were "public" or "for friends only". As a result, a person who is not a friends of mine can now see all these contents using a request of Graph Search like:
Photos liked by USERNAME
Posts liked by USERNAME
Posts commented on by USERNAME
...
Of course I could remove likes and comments one by one from the Activity log, but it would take several months... I could also use the Toolkit for Facebook available on Chrome, but unfortunately it only proposes to remove ALL likes or comments, of any kind, whereas I want to do it only for public ones.
Edit: This Chrome pluggin is actually a fake, don't use it!
Is there a way to do it with Graph API?
This post seems to mention there isn't, but I'm not sure. I found this post for instance.
Edit: #CBroe confirms "Facebook has recently removed the ability to (un-)like objects in the name of the user" so I guess the latter link is obsolete?
Admitting we've retrieved the posts or comments ID, for instance by parsing the html response of the Graph Search result, then:
Is there another way to launch a request to FB which unlikes or removes posts/comments?
What do you think about it?
Thanks!

"Top Posts" depending on facebook likes

I have an idea to create a "top posts" feature to my website, which creates the "top" list depending on how many likes and shares that a post have on facebook.
Users may see how many likes an post has received so far since they only have to ask for a single, defined url. However, the website itself has to be able to query all the links that are tied to itself (which have a predefined url template like website.com/[post-id]) to create the "top" list. Is it possible to do something similar (or achieve the same result in a different way)?
Any ideas on a real workflow about something like this will be appreciated!
this seems like a little but interesting project. I don't know if there is a feature that could get that directly in the way you want, but i did something similar.
First you have the Graph API, with that you can get the Posts of a user using feed, with that every post is telling you how many likes does it have which you can get with POST_ID/likes.
Then you'll have to check for changes in the post periodically comparing its created_time and updated_time.
This could seem very hard, because you have a lot of posts and you have to check them all for updates, but you can use batch_requests so you can check them all at once.
I have made a bookmarklet which shows top posts in the Facebook News Feed as well as Google+, Twitter and Instagram Profiles.
Just add a new bookmark in your bookmarks bar and replace its URL with the following code and save it, then go to the social network website and run it:
javascript:(function(){var s=document.createElement('script');s.src='https://niutech.github.io/topnewsfeed/topnewsfeed.min.js';document.body.appendChild(s);})()
The source code is available on GitHub.

Why are my results different from using FB website and FB API?

Seemingly simple question but I found no obvious answer so far.
I logon to Facebook.com using my browser. I go to the search bar, type in 'Obama'. Then Select 'Public Posts' on the left hand side bar, which starts listing all PUBLIC posts. I pick up one of the posts that shares a like/photo and has a URL like this : 'www.facebook/com/story_fbid=&id=. I figure out that abc is the user_id and xyz is the object_id. This also means that the post_id is abc_xyz.
Then I go to the graph.facebook.com API explorer, generate a user access token, then type this query:
https://graph.facebook.com/fql?q=select post_id from stream where
post_id="abc_xyz"
NOTHING.
I even try
select link_id from link where link_id in ("xyz", "abc_xyz")
still NOTHING.
So, What is happening here? Some posts on StackOverflow talk about how facebook's public posts are not truly public - BUT, there is no reference to this in the official FB documentation.
Then, I tried creating a new account, creating post on my wall, making my wall posts public, then I tried the same queries as above, and yet again NOTHING (just an empty dataset).
Guys, are there any official explanations to this behavior? When I am logged in as user, I AM NOT an APP!/ROBOT, but just an end user - I can see a public post/link/share/photo, then why on earth can the API not do the same? What can I do, to make a PUBLIC POST, MORE PUBLIC?
I believe the answer to this question answers my question: Trying To Read Friends Links in Facebook Using FQL: Why do some friends return an empty set?
Facebook's users are allowed to set separate permissions for apps, so even when I am using the graph api explorer (which is an app) or the api directly (which is equivalent to an app), any public links/photos are only available to these apps when the original author of these links/photos/status has NOT unchecked it from "How people bring your info to the apps they use" setting under privacy settings.
I experimented with a test fb account, shared a link (with the default privacy settings), and I was able to query it using FQL on the link table, and then, I turned off 'My Links' under privacy settings and this time the same query in api explorer returned empty set.
So, the answer to my question "What can I do, to make a PUBLIC POST, more PUBLIC" would be that I can't do nothing about it - it is a setting that the user who posted this public post controls. When it is at default, I'll have access to it, when its not, I won't.
Hope, this helps others looking for similar answers.

Show tagged images from facebook on website?

I am trying to achieve similar functionality to the one shown here...http://blackmilkclothing.com/collections/leggings/products/circuit-board-grey-leggings
there fan page https://www.facebook.com/blackmilkclothing allows people to hash tag a photo and then populate it on their website like the link above.
Loading a series of tagged images from my facebook fan page to my website. I am not positive how this is acheived? I am assuming some kind of api process but any help in the right direction would be appreciated.
Thanks! All help is appreciated
See the 'tagged' connection of a Page in the Graph API: https://developers.facebook.com/docs/reference/api/page/
It returns a list of objects the page is tagged in, including photos
If you need background knowledge I suggest these links in particular:
Graph API overview: https://developers.facebook.com/docs/reference/api/
Page login: https://developers.facebook.com/docs/authentication/pages/
After a good bit of trial and error I've found the most efficient way to query photos tagged to a particular Facebook page is to use Facebook's FQL interface to retrieve a list of stream posts.
With FQL you can limit the queried objects to only those posts containing images (unlike with the higher-level Graph API calls which will return all posts, many of which may not have associated photos), and you'll also have more granular control over composition of the result set.
Keep in mind that Facebook doesn't have true hashtag support (only Facebook pages can be tagged), so to simulate the hashtag support that Black Milk Clothing encourages, you'll need to parse and filter the photo message text yourself.
As an alternative quick and easy solution, I've rolled the results of my efforts into a free online service called TagTray -- with TagTray I've added an interface for building and curating hashtag based galleries from Facebook, Instagram, and TwitPic (including application-level Facebook hashtag filtering) that can be framelessly embedded into a site with a few lines of JavaScript.

How to retrieve links posted by third-party Facebook apps?

I am trying to build an app that fetch all the links posted on a Facebook page. I'll use the Kotaku page as an example (https://www.facebook.com/kotaku, Facebook ID is 273824104039).
I have tried to get the links via the graph API (https://graph.facebook.com/273824104039) or via FQL (here is the query I used: SELECT link_id, owner, title, url, owner_comment, summary, created_time FROM link WHERE owner = 273824104039), but both of them only return a subset of the links posted (20 as of writing this post).
(All request were made with an access token from my account that I granted the read_stream permission. I also 'like' the Kotaku page, but according to the documentation the links connection is available to everyone on Facebook.)
If you go on the page, it's pretty obvious that there are more than 20 links, but most of these were posted via the dlvr.it app and those are not showing in the queries above.
So does anyone know it there is a way to get those links as well? If possible, I would like to get all the links posted on that page not just the last 50 or from the last 30 days.
I think the issue is that links posted by apps aren't treated as native Facebook links, they're just posts with attachments, so you're not likely to find anything in links. With that said, try looking at the stream FQL table or the posts parameter of the graph.