def fb_get_feed(fb_target_page_id): print("Getting facebook feed") fb_page = Page(fb_target_page_id) #fields = ["id","permalink_url","created_time","from","comments.summary(true)","likes.summary(true)"] fields = ["id", "permalink_url", "created_time", "from"] fb_feed = fb_page.get_feed(fields=fields, params={}) # "limit":100}) fb_post_list = list(fb_feed) return fb_post_list
def fb_get_api_feed(fb_target_page_id, limit): if limit == None: limit = 100000 print("Getting facebook feed") fb_page = Page(fb_target_page_id) #fields = ["id","permalink_url","created_time","from","comments.summary(true)","likes.summary(true)"] fields = ["id", "permalink_url", "created_time", "from"] page_token = get_fb_page_token(fb_target_page_id) fb_feed = fb_page.get_feed(fields=fields, params={"limit": limit}) fb_post_list = list(fb_feed) print("Retrieved {} posts".format(len(fb_post_list))) return fb_post_list, page_token