如何从一个Facebook页面的所有事件 [英] How to get all events from a facebook Page

查看:198
本文介绍了如何从一个Facebook页面的所有事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有万吨StackOverflow的答案有关从Facebook页面获取事件。
他们都列出FQL查询,我敢肯定,他们所有的工作很好;但因为我是新来这个我不知道,什么情况下这些查询被执行以及如何连得远远不够使用这些查询。

There are tons of StackOverflow answers about getting events from a facebook Page.
They all list a FQL query and I'm sure they all work great; but since I'm new to this I have no clue as to what context these queries are executed and how to even get far enough to use these queries.

让所有事件从Facebook页面应该是pretty的琐碎。有可能应该是一个完整的复制+粘贴解决方案,每一种语言,但我一直没能找到它。

Getting all events from a facebook Page should be pretty trivial. There should probably be a complete copy+paste solution in every language but I haven't been able to find it.

在理想情况下,我想一步一步的解决方案,在JavaScript或C#的工作。

Ideally, I would like a step-by-step solution that works in javascript or C#.

这是pretty的太多我想做的事情,我看不出有任何理由为什么不应该在公共页面的工作(但事实并非如此):

This is pretty much what I want to do and I see no reason why this shouldn't work on a public Page (but it doesn't):

<script>
    FB.init({
        appId: "196804317007661", // the appId for the website I registered with FB
        status: true, // check login status
        cookie: true, // enable cookies to allow the server to access the session
        xfbml: true  // parse XFBML
    });
    FB.api({
        method: "fql.query",
        query: "SELECT eid, name FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = PublicPageIdGoesHere)"
    },
    function (response) {
        console.log(response);
});

那么,谁知道得到这个工作的一个插件正播放的方式?

So, anyone know of a plug-n-play way of getting this to work?

推荐答案

我知道的例子是在VB,但我敢肯定,你可以把它移植到C#没有问题。下面是使用分行FB API 库中的一个例子。

I know the example is in VB but I'm sure you can port it to C# no problem. Here is an example using the Branches FB API library.

Dim FB As New SessionInfo("[access_token]")
Dim Req = New Functions.Requests(FB)
Dim EL = Req.GetEvents("[PageID]")
For Each E In EL
    Response.Write(E.id)
    Response.Write(E.name)
Next

这假定您已经从FB的access_token。如果没有,你可以检查出的API认证的例子。它的.Net,所以你可以使用它与C#。

This assumes that you already have an access_token from FB. If not you can check out the authentication example on the api. It's .Net so you can use it with C#.

这篇关于如何从一个Facebook页面的所有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆