Skip to main content

Unshorten the URLs in your Twitter archive

Project description

twitter-archive-unshorten

Twitter's archive download includes shortened t.co URLs instead of the original URLs that you tweeted. If Twitter ever goes away, the server at t.co won't be available to respond to requests.

unshorten.py is a small Python program that will examine all the JavaScript files in the archive download and rewrite the t.co short URLs to their original full URL form. This means the context for your archived tweets will make a little more sense after Twitter is gone. Maybe you can look up those URLs in the Internet Archive if they are no longer available. This would be impossible if all you had was the short URL.

Run

  1. Unzip your Twitter archive zip file.
  2. Download unshorten.py.
  3. Open a terminal window and run: python3 unshorten.py /path/to/your/archive

It might take a while, depending on how many tweets you have. Once it's finished you should be able open your Archive and interact with it without the t.co URLs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twitter_archive_unshorten-0.0.3.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

twitter_archive_unshorten-0.0.3-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page