Facebook : Graph API Callbacks / Real-time API / Public Feed API

心不动则不痛 提交于 2019-12-14 03:50:24

问题


I'm working on a social media project where in I need to follow a few fanpages and listen to all whats happening on that particular page. I for a fact know that there are some data resellers like GNIP & Datasift who can provide me such data. I have tried both trials.

What I want to know is that, is there a way to do this via the Facebook public feed & graph APIS, I know with this I'll be restricted only to a open posts, but that's ok for now.

I have downloaded the Facebook C# SDK and I'm able to get details of the Fan Pages, Album comments for groups I have credentials of but is there a way to get real-time updates through the api?

For e.g I want insert all that happens on my pages into a DB for reporting. I want to keep a track of any posts (photos/videos/status/events) and people's comments on it.

I read this link explaining the realtime updates API.But I do not know how to go about it using facebook C# SDK.I have never setup a callback url ,I ain't familiar with it, but is this the solution where in using Facebook C# SDK I can get some callbacks that a new interaction occured?

Thanks in advance. I may sound very boggling but I'm sure I've done justice in explaining my point.

Here is some sample code that I have tried:

public void FBPing() {
    var client = new FacebookClient();
    //dynamic FBObj = client.Get("fanpagename", new { fields = "albums" });
    dynamic FBObj = client.Get("fanpagename");
    OutputBox.AppendText(" about " + FBObj.about + "\r\n\r\n");
    OutputBox.AppendText(" username" + FBObj.username + "\r\n\r\n");
    OutputBox.AppendText(" category " + FBObj.category + "\r\n\r\n");
    OutputBox.AppendText(" likes " + FBObj.likes + "\r\n\r\n");
    OutputBox.AppendText(" talking_about_count " + FBObj.talking_about_count + "\r\n\r\n");
    OutputBox.AppendText(" were_here_count " + FBObj.were_here_count + "\r\n\r\n");
    OutputBox.AppendText(" description " + FBObj.description + "\r\n\r\n");
    OutputBox.AppendText(" company_overview " + FBObj.company_overview + "\r\n\r\n");
    OutputBox.AppendText(" genre " + FBObj.genre + "\r\n\r\n");
    OutputBox.AppendText(" is_published " + FBObj.is_published + "\r\n\r\n");
    OutputBox.AppendText(" plot_outline " + FBObj.plot_outline + "\r\n\r\n");
    OutputBox.AppendText(" release_date " + FBObj.release_date + "\r\n\r\n");
    OutputBox.AppendText(" starring " + FBObj.starring + "\r\n\r\n");
    OutputBox.AppendText(" username " + FBObj.username + "\r\n\r\n");
    OutputBox.AppendText(" website " + FBObj.website + "\r\n\r\n");
    OutputBox.AppendText(" written_by " + FBObj.written_by + "\r\n\r\n");
    OutputBox.AppendText(" id " + FBObj.id + "\r\n\r\n");
    OutputBox.AppendText(" name " + FBObj.name + "\r\n\r\n");
    OutputBox.AppendText(" link " + FBObj.link + "\r\n\r\n");
    OutputBox.AppendText(" Cover cover_id " + FBObj.cover.cover_id + "\r\n\r\n");
    OutputBox.AppendText(" Cover source " + FBObj.cover.source + "\r\n\r\n");
}

EDIT 1 This post tells me that I need a combination of Facebook Public Feed API & Graph API to achieve what I want to but I'm still a newbee when it comes to setting up an HTTPS endpoint or creating a call back url. Do they both mean the same?

Also I have seen this github that explains ASP.NET Callback ashx. I think I'm almost there and have done a lot of research. I would just want someone to connect the dots for me, so I see the picture clearly. I will keep updating this questions as I find something.

EDIT 2 I have queried both the GRAPH API and FQL for data, what I now need is only to setup an HTTP endpoint to get real-time updates from the public feed api. I wonder if I could use Messaging Queues here like MSMQ or Rabbit MQ? Please share some concrete documentation links (as Facebook C# SDK lacks proper documentation), I will take it from there :)

来源:https://stackoverflow.com/questions/21719434/facebook-graph-api-callbacks-real-time-api-public-feed-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!