如何从 Facebook 页面获取所有事件
StackOverflow 有大量关于从 Facebook 页面获取事件的答案。
它们都列出了 FQL 查询,我确信它们都工作得很好;但由于我是新手,所以我不知道这些查询是在什么上下文中执行的,以及如何进一步使用这些查询。
从 Facebook 页面获取所有事件应该非常简单。每种语言可能都应该有一个完整的复制+粘贴解决方案,但我还没有找到它。
理想情况下,我想要一个适用于 javascript 或 C# 的分步解决方案。
这几乎就是我想做的事情,我看不出为什么这不能在公共页面上工作(但事实并非如此):
<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);
});
那么,有人知道一种即插即用的方式来让它工作吗?
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.
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.
Ideally, I would like a step-by-step solution that works in javascript or C#.
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道该示例是用 VB 编写的,但我确信您可以将其移植到 C# 中,没有问题。以下是使用 Branches FB API 库的示例。
这假设您已经拥有 FB 的 access_token。如果没有,您可以查看 api 上的身份验证示例。它是 .Net,因此您可以将其与 C# 一起使用。
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.
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#.