如何通过 FQL 获取 Facebook 视频配置文件

发布于 2024-11-08 19:06:48 字数 1249 浏览 0 评论 0 原文

if (!IsPostBack)
{
    var auth = new CanvasAuthorizer(fb);
    if (!auth.IsAuthorized())
    {
        var url = auth.GetLoginUrl(new HttpRequestWrapper(Request));
        var content = CanvasUrlBuilder.GetCanvasRedirectHtml(url);
        Response.ContentType = "text/html";
        Response.Write(content);
        Response.End();
        return;
   }
   dynamic me = fb.Api("/me");
   if (fb != null)
   {
        FacebookID = fb.Session.UserId;
        AccessToken = fb.Session.AccessToken;
   }    
   FacebookApp fbapp = new FacebookApp(AccessToken);
   dynamic videos = fbapp.Fql("SELECT vid, owner FROM video WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me())");    
   foreach (dynamic v in videos)
   {
       // Can't return videos here
   }    
}

但是当我执行这个fql时没有视频。

但是上面这段代码,我使用了另一个fql,如:

dynamic fanpages = fbapp.Fql("SELECT page_id, name, pic_big, type, page_url FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid=me() or uid in (SELECT uid2 FROM friend WHERE uid1=me()))");

foreach (dynamic fan in fanpages)
{
// Can return fan page in here
}

我认为的问题是AccessToken。该AccessToken在fql视频表时不能有权限,但在fql粉丝专页时可以有权限。

任何人请帮助我。

非常感谢。

if (!IsPostBack)
{
    var auth = new CanvasAuthorizer(fb);
    if (!auth.IsAuthorized())
    {
        var url = auth.GetLoginUrl(new HttpRequestWrapper(Request));
        var content = CanvasUrlBuilder.GetCanvasRedirectHtml(url);
        Response.ContentType = "text/html";
        Response.Write(content);
        Response.End();
        return;
   }
   dynamic me = fb.Api("/me");
   if (fb != null)
   {
        FacebookID = fb.Session.UserId;
        AccessToken = fb.Session.AccessToken;
   }    
   FacebookApp fbapp = new FacebookApp(AccessToken);
   dynamic videos = fbapp.Fql("SELECT vid, owner FROM video WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me())");    
   foreach (dynamic v in videos)
   {
       // Can't return videos here
   }    
}

But there is no videos when I execute this fql.

But with this code above, I use another fql, such as:

dynamic fanpages = fbapp.Fql("SELECT page_id, name, pic_big, type, page_url FROM page WHERE page_id IN (SELECT page_id FROM page_fan WHERE uid=me() or uid in (SELECT uid2 FROM friend WHERE uid1=me()))");

foreach (dynamic fan in fanpages)
{
// Can return fan page in here
}

The problem I think is AccessToken. This AccessToken can't have permission when fql video table, but can have permission when fql fan pages.

Anybody please help me.

Thanks very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂ガ小子 2024-11-15 19:06:48

借助新的 graph API,您可以通过 URL 而不是使用 fbapp 来访问它.fql() 调用。这非常简单。帮助这有帮助

With the new graph API, you access it via an URL instead of using fbapp.fql() calls. It is quite straightforward. Help this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文