Cannot access all groups through facebook api in Python -
i trying access facebook workplace using facebook api. there several groups in workplace first 25 groups out of 100+ groups. wondering there setting can use information groups.
any suggestions great !!
token = "adsfhjksajfakshlkfjalf" days = 2 graph_url_prefix = "https://graph.facebook.com/" groups_suffix = "/groups" # default paging limit graph api default_limit = "100000" verbose = true since = datetime.datetime.now() - datetime.timedelta(days=days) headers = {'authorization': 'bearer ' + token} params = "?fields=feed.since(" + since.strftime("%s") + ").limit(1000),name,updated_time&" params += "&limit=" + default_limit after = none if after: params += "&after=" + after graph_url = graph_url_prefix + "community" + groups_suffix + params result = requests.get(graph_url, headers=headers) result_json = json.loads(result.text) groups = [] if "data" in result_json: group_obj in result_json["data"]: if "feed" in group_obj: groups.append(group_obj) in range(len(groups)): print (groups[i]['name'])
Comments
Post a Comment