Skip to content

Instantly share code, notes, and snippets.

@silverwolfceh
Created September 4, 2018 09:41
Show Gist options
  • Save silverwolfceh/c552ec9492cf7f097f25d3cd76a1a2fe to your computer and use it in GitHub Desktop.
Save silverwolfceh/c552ec9492cf7f097f25d3cd76a1a2fe to your computer and use it in GitHub Desktop.
Accept group member
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