Facebook Open Graph Follows - facebook

Similar to the ability to subscribe to a user's posts on Facebook, users can since today, follow other users' Open Graph activities from a specific app. For example, on a movie review site, users can follow their favorite movie reviewers.
There's no example of this yet, but if you submit the new follow action you'll get the code and have an idea of how it goes. It's very easy: hit(GET) https://graph.facebook.com/me/og.follows with a token and a profile ID. What I don't get is the third_party_id.
I have read this sentence over and over and still can't decode it: "This tag is not required, and follow actions will succeed without it, though followers will not see activity in their News Feeds without this."
How to use the third_party_id? And most important, from now on, only the actions from the the people I subscribe to will been seen on my feed?
Full info here: https://developers.facebook.com/docs/opengraph/actions/builtin/follows/

What I don't get is the third_party_id.
If you’re posting a follow action not for a facebook profile, but for an URL (as in the example, profile=http://www.rottentomatoes.com/celebrity/tom_hanks/), then that page has to have a <meta property="fb:profile_id" …> element to tell Facebook what to actually follow.
To get the third_party_id, you query the Graph API for a user with /userid/?fields=third_party_id.
(I’m guessing using the third_party_id in this place instead of the actual user id is just recommended for the simple reason, that this way not everyone who looks into the HTML code of the rottentomatoes page can see what FB uid Tom Hanks actually has.)
If there is no corresponding user on Facebook for the URL that’s being followed – then there isn’t anything to follow at all, because there will be no posts on Facebook that could been shown in a user’s feed.

How to use the third_party_id?
This could have been explained better by Facebook. I think it works like this:
Lets say William followed Claudette in your app and that your app successfully published a follow action on facebook. Whether you provide Claudette's third_party_id or not, a story that William followed Claudette, will get published on William's News Feed.
However if Claudette's third_party_id is provided, then William will start getting stories about ALL of Claudette's actions published by your app. Now, thats pretty cool. But of course to do this, Facebook needs to know "who Claudette is" which is what third_party_id does.
To summarize, by not providing third_party_id the follow action gets shared on William's news feed and potentially to William's friends. But thats a one time thing. By providing the third_party_id you are extending the virality and ensuring a constant flow from Claudette to William for actions Claudette does on your app.

Related

Facebook API - How to get content of specific comment using Facebook api?

I have been asked to create a Facebook app that reads a Facebook user's news feed.
For now I have found out how to read a Facebook user's news feed via the /[user-id]/home path. My issues is that I don't know how to get the content of a user's comment on a video/photo etc.. For example, when I call the /[user-id]/home path I can see that a user (friend of [user-id]) has made a comment on a "video-post". I can see the "news ID" of the friend's "action" as '[user-id-of-friend]_[id-of-post-commented-on]', but how can I get the ID of the actual comment, which I need to be able to retrieve the content of the actual comment? The comment ID should look something like '[post-id]_[comment-id]' if I am not mistaken. I need the comment ID to get the detailed information about the comment when making a call to the /[post-id]_[comment-id] path.
A possible, slow and tedious, workaround would be to get all the comments of the "video-post" (calling /[post-id]/comments) and iterate through all the comments until I find the comment of the specific user.

Post via open graph to Company Page NOT user

As I am learning and getting familiar with the FB OG API I am finding that I am lacking some of the basics. For example I see here that I use the action type news.publishes to post an article. However the access_token is for the user owning the page and thus it will go to their news feed and not the page (in this case their company page). Correct?
If I understand correctly then how does one get it to post to a specific page. Is there an access_token collection you iterate through till you find the one for the company page?
TIA
JB
You should be able to use /PAGE_ID/feed? Where page id is the numerical assigned by facebook..or the text friendly name you used.

"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.

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.

wall posts and fb:multi-friend-selector

Firstly i know that the documentation provided by Facebook says that fb:multi-friend-selector can be used in pair with fb:request-form and that it could only sends inviations or requests.
I have more specific need and that is not only to make invitations/requests but also along with the previous to post something on selected friends walls.
I've tried everything but i cant take the id's selected from the fb:multi-friend-selector, so i'm unable to make this posts.
The doucmentation for fb:multi-friend-selector says: This interface includes a series of which are included for selected users in the form that gets submitted to your action URL.
Is it somehow possible to catch this id's?
I'm working on my app in C# .net.
I read in some of the previous posts that is treating problematics similar to mine that is impossible to do this, but i found application that works perfectly in way that i want to make my application.
Thanks in advance,
Ivan
You can access the selected friend's id in the page that you are providing in "action" of fb:request-form.I am working with PHP so i am able to get those selected friend's id as $_REQUEST['ids'].So try some equivalent methods in c# for this.And if you get the friend's id you can publish to their wall.