3

I am trying to get info for every user who liked a post within a given timeframe. As such, I am using facepy in oder to get the data from the facebook api. Now I need to now how I can paginate the data I receive from the api, however i cant get it to work. I've been looking for different solutions that use the facebook sdk, however i cant get them them to work either.

My code so far looks as follows:

graph_data = graph.get('me/posts?fields=likes',since=sTime, until=uTime)


for info in graph_data['data']:
    while True:   
       try:
           for comment in info['likes']['data']:

               print comment
           info =requests.get(info['likes']['paging']['next']).json()
       except KeyError:
           break

I receive as output the people who liked each post within the timeframe, however I realize that this list does not include all the users who liked (as i can see more on facebook)

Thank you very much!

0 Answers0