Skip to content

Instantly share code, notes, and snippets.

@tveastman
Created December 29, 2021 22:11
Show Gist options
  • Save tveastman/dca883a769295a379259397225b3babd to your computer and use it in GitHub Desktop.
Save tveastman/dca883a769295a379259397225b3babd to your computer and use it in GitHub Desktop.
import os
from TwitterAPI import TwitterAPI
api = TwitterAPI(
consumer_key=os.environ["CONSUMER_KEY"],
consumer_secret=os.environ["CONSUMER_SECRET"],
access_token_key=os.environ["ACCESS_TOKEN"],
access_token_secret=os.environ["ACCESS_TOKEN_SECRET"],
)
for id in api.request("friends/ids").get_iterator():
r = api.request(f"friendships/destroy", dict(id=id)).json()
print(f"{r['name']} (@{r['screen_name']})")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment