Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何获得喜欢我的“用户”列表;邮政「;使用Facebook图形API?_Python_Facebook Graph Api - Fatal编程技术网

Python 如何获得喜欢我的“用户”列表;邮政「;使用Facebook图形API?

Python 如何获得喜欢我的“用户”列表;邮政「;使用Facebook图形API?,python,facebook-graph-api,Python,Facebook Graph Api,我无法从API访问用户名。我只能访问喜欢的人的数量,而不能访问喜欢它的人的列表。 我试过这么做- def get_post_likes(post): mylikes=[] try: likes=graph.get_connections(post['id'],connection_name='likes') print (post['message']) #print(likes['data']) mylikes = get_all_pages

我无法从API访问用户名。我只能访问喜欢的人的数量,而不能访问喜欢它的人的列表。 我试过这么做-

def get_post_likes(post):
   mylikes=[]
   try:
     likes=graph.get_connections(post['id'],connection_name='likes')
     print (post['message'])
     #print(likes['data'])
     mylikes = get_all_pages(likes)
   except:
     pass 
   return mylikes

def get_all_pages(posts):
   allposts=[]
   allposts = posts['data']
   while(1):
      try:
         next_page_url=posts['paging']['next']  #get url for next page
      except KeyError:
         break
      posts = requests.get(next_page_url).json()
      allposts += posts['data']
   return allposts
但是like['data']是空的,尽管我的帖子都没有0个like。 即使在图形API浏览器中,我也无法访问名称


你说的是一篇页面文章吗?你现在需要使用页面访问令牌来获取该上下文中的任何类型的个人用户信息。我说的是我自己的帖子,即从我的用户名。我猜出于隐私原因,这是不可能的,然后我猜你可能会为同样使用你的应用程序的朋友获取,但对于其他人-不。