Skip to content

Instantly share code, notes, and snippets.

@Lucent
Created January 3, 2026 23:39
Show Gist options
  • Select an option

  • Save Lucent/5009028861d523564089e2306ce19c14 to your computer and use it in GitHub Desktop.

Select an option

Save Lucent/5009028861d523564089e2306ce19c14 to your computer and use it in GitHub Desktop.
tweets.js from Twitter export displayed as plain text prefixed with date/time
#!/usr/bin/env bash
set -Eeuo pipefail
sed '1 s/^[^[]*\[/[/' "$1" |
jq -r '
def sortable_date:
.tweet.created_at
| strptime("%a %b %d %H:%M:%S %z %Y")
| mktime
| . - 18000
| strftime("%Y-%m-%d %I:%M%p");
map(.tweet.sortable_date = sortable_date)
| sort_by(.tweet.sortable_date)
| .[].tweet
| "\(.sortable_date): \(.full_text | gsub("\n"; "|"))"
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment