Created
September 4, 2018 09:41
-
-
Save silverwolfceh/c552ec9492cf7f097f25d3cd76a1a2fe to your computer and use it in GitHub Desktop.
Accept group member
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_remove_uid_in_group(uid, gid, config, atype = "post"): | |
access_token = config["config_tools"]["access_token"][0] | |
data = {"access_token": access_token, "method" : atype} | |
url = "https://graph.facebook.com/%s/members/%s" % (gid, uid) | |
while True: | |
try: | |
res = requests.post(url, data=data) | |
return res.text | |
except Exception as e: | |
print(e) | |
print("Retry...") | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment