开发者

How to get facebook video profile by 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 = "t开发者_C百科ext/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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜