FQL get liked artists

时光总嘲笑我的痴心妄想 提交于 2019-12-11 11:23:46

问题


Is it possible, using FQL, to get the liked artists(music) of a user? I check the permissions and I couldn't find anything related to it and I am not a facebook user so I am not sure if it's even possible.


回答1:


The Like table doesn't give back the interests, but:

An FQL table that returns the IDs of users who like a given object (video, note, link, photo, or album).

That's not what we need.

First way - Rapid description

In the User table, you'll find a music field which sends back one line containing all the liked artists. The query would be as easy as:

SELECT music FROM user WHERE uid = me()

{
  "data": [
    {
      "music": "Macarize, MARCEL DETTMANN, Alan Fitzpatrick"
    }
  ]
}

Second way - Detailed results

By the Page_fan table we get the user's music interests one by one.

SELECT name, type FROM page WHERE page_id IN (
    SELECT page_id FROM page_fan WHERE uid=me() AND profile_section="music")

{
  "data": [
    {
      "name": "Macarize", 
      "type": "RECORD LABEL"
    }, 
    {
      "name": "MARCEL DETTMANN", 
      "type": "PRODUCER"
    }, 
    {
      "name": "Alan Fitzpatrick", 
      "type": "MUSICIAN/BAND"
    }
  ]
}


来源:https://stackoverflow.com/questions/14035638/fql-get-liked-artists

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!