Last active
November 18, 2022 03:07
-
-
Save bennyfactor/72aa9d21965aa7cac36dd24081975d0a to your computer and use it in GitHub Desktop.
Get all those t.co links before they're gone forever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# go to the base directory of your twitter archive, ie something like twitter-YYYY-MM-DD-deadbeefcafe42069 | |
# run this for loop: | |
for i in `grep -oh "https://t.co/[[:alnum:]]*" data/*.js | sort | uniq` | |
do | |
echo $i $(curl -Is ${i} | grep location | sed -e 's/location./, /') | sed -e 's/ ,/,/' | tee -a tco.csv | |
done | |
# this will take ... a while. It will save them to a csv file called tco.csv. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment