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

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!

Related

Loading comments from facebook

I got an application that posts stories to Facebook (actions and objects are cutom).
Stories (when they are on facebook) can be commented, liked and shared.
My question is: is there a program way to load that stories' comments and likes (count at least)?
I tried an FQL like this, but it did not work:
select likes from comment where object_id=605173452834516
object_id was taken from object browser (the object was shared in my timeline and I commented and liked it).
By the way, my app currently is in sandbox mode - can it be the reason I can not query the comments and likes?
Can you give example of public post_id? So other people can access the content to test.
This example works fine:
select likes from comment where object_id='10151558994286749'
Original link: https://www.facebook.com/photo.php?fbid=10151558994286749&set=a.53081056748.66806.6815841748&type=1
If you scare is your app setting problem, you can test on this way:
Copy user access token of your app, then paste/replace into Access
token field at
https://developers.facebook.com/tools/explorer?fql=select%20likes%20from%20comment%20where%20object_id%3D'10151558994286749'

Get only timeline posts, from facebook feed request

I'm trying to build an app using facebook's JS SDK and Graph API, and got a little confused in process. The idea is simply to take every post user have created on his timeline. As listed in docs to do this you need to call feed connection, to get an array of post object representing posts users make to their wall.
The thing is when using standard request to get last 30 post (with read_stream permission)
FB.api('/me/feed?limit=30&format=json', function(response) {
//operations on response.data
}
in response graph api returns not only the timeline posts user made, but also some of comments on other peoples posts. So it seems feed doesn't return just "The user's wall." posts, as written in doc, but all things user posted. Request to */user_id/posts* is giving pretty much the same result.
The confusing part is that user text posts to his/hers timeline and comments on other people's posts have the same type of "status". The difference between them is that timeline post has it's content in "message" field and comment stores text in "story".
So my question: Is there a way to sort only timeline posts made by user, within a request itself?
So after facebook updated it's docs it is now clear that you need to call /{user-id}/posts to show only the posts that were published by user.
Call to /{user-id}/feed on the other hand returns the feed of posts, including status updates and links published by user, or by others on user's profile.
More about so called "derivative edges" here: https://developers.facebook.com/docs/graph-api/reference/user/#edges

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.

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.

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

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.