Recovering front-end developer, now I just write JavaScript

Unshorten URLs

How to convert a list of short URLs into a list of unshortened URLs

Say you have a text file called old-urls.txt that looks like this:

We know those redirect to a fuller URL, but don't yet know what.

Run this in your terminal:

cat old-urls.txt | while read f; do echo "${f}"; curl -Ls -o /dev/null -w %{url_effective} "${f}" -O; echo "\n"; done;

And get a readout in the terminal like:

You can then turn that into some JSON or whatever format you need to work with.