如何通过Facebook API获得好友 [英] How to get friends likes via Facebook API

查看:108
本文介绍了如何通过Facebook API获得好友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这样可以让我所有的朋友都喜欢吗?现在,我得到这个两步:


  1. 获取我所有的朋友列表

  2. 由迭代这些列表我得到所有个人喜欢,

但似乎非常大的过程,任何人都有想法来提高这个性能任务?

解决方案

最后,我在2周后发现了Facebook API文档

  FB.api(/ likes?ids = 533856945,841978743)

FB.api(me / friends,{
fields:'id',
limit:10
},function(res){
var l =''
$ .each res.data,function(idx,val){
l = l + val.id +(idx })
FB .api(likes?ids =+ l,function(res){
console.log(res);
})
})


Is this possible to get all my friends likes?? Now, I'm getting this by 2 steps:

  1. Getting all my friends list
  2. By iterating those list I'm getting all individuals Likes,

but it seems very big process, anybody have idea to improve the performance for this task?

解决方案

At last I found it after 2 weeks looking at Facebook API documentation

FB.api("/likes?ids=533856945,841978743")

FB.api("me/friends",{
  fields:'id',
  limit:10
},function(res){
  var l=''
  $.each(res.data,function(idx,val){
     l=l+val.id+(idx<res.data.length-1?',':'')
  })
  FB.api("likes?ids="+l,function(res){
      console.log(res);
  })
})

这篇关于如何通过Facebook API获得好友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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