Skip to content

Instantly share code, notes, and snippets.

@tdhopper tdhopper/tweets.sh
Created Aug 5, 2016

Embed
What would you like to do?
Find your tweets from this date in earlier years.
# Find your tweets from this date in earlier years.
# OS X's date function doesn't have the required date math capabilities.
# This requires GNU date. You can get it on OS X with `brew install coreutils`
GDATE=/usr/local/bin/gdate
USERNAME=realDonaldTrump
export URL="https://twitter.com/search?q=from%3A$USERNAME%20("
for yearsago in {1..12}; do
# echo $URL
URL=$URL"(since%3A"$($GDATE '+%Y-%m-%d' -d "$yearsago year ago")"%20until%3A"$($GDATE '+%Y-%m-%d' -d "$($GDATE '+%Y-%m-%d' -d "$yearsago year ago") 1 day")")%20OR%20";
done;
open $URL")"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.