Skip to content

Instantly share code, notes, and snippets.

@nat
Last active August 9, 2022 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nat/5c538c4aa061812d449db1bc1185bec7 to your computer and use it in GitHub Desktop.
Save nat/5c538c4aa061812d449db1bc1185bec7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
#
# A script to strip the tracking cookies from Twitter links in your clipboard.
#
import pasteboard
import time
pb = pasteboard.Pasteboard()
while True:
str = pb.get_contents()
if str is not None and str.startswith('https://twitter.com/') and str.find('t=') != -1:
str = str.split('?')[0]
pb.set_contents(str)
time.sleep (0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment