Create a gist now

Instantly share code, notes, and snippets.

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")"