Skip to content

Instantly share code, notes, and snippets.

@cmj
Last active January 1, 2025 16:30
Show Gist options
  • Select an option

  • Save cmj/62ab48eebb4a5c599fa322d5f6850689 to your computer and use it in GitHub Desktop.

Select an option

Save cmj/62ab48eebb4a5c599fa322d5f6850689 to your computer and use it in GitHub Desktop.
grab last 100 (hidden) likes from a twitter user
#!/bin/bash
# grab the last ~100 (hidden) likes from a twitter user
# requires account, 2 parameters from header
x_csrf_token='XXXXXXXXXX'
auth_token='XXXXXXXXXX'
####
usage() { echo "$0 username"; exit 1; }
[ "$#" -ne 1 ] && usage
user="$1"
bearer_token='AAAAAAAAAAAAAAAAAAAAAFQODgEAAAAAVHTp76lzh3rFzcHbmHVvQxYYpTw%3DckAlMINMjmCwxUcaXbAN4XqJVdgMJaHqNOFgPMK0zN1qLqLQCF'
curl -s "https://api.twitter.com/1.1/favorites/list.json?count=100&include_my_retweet=true&screen_name=${user}&cards_platform=Web-13&include_entities=true&include_user_entities=true&include_cards=true&send_error_codes=true&tweet_mode=extended&include_ext_alt_text=true&include_reply_count=true" \
-H "Authorization: Bearer $bearer_token" \
-H "X-Csrf-Token: ${x_csrf_token}" \
-H "Cookie: ct0=${x_csrf_token}; auth_token=${auth_token}" | \
jq -C | bat
# tee -a incoming.out | \
# fx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment