Created
December 2, 2018 22:46
-
-
Save rolandcrosby/b7762abe911417758df9dceac3eb3ea6 to your computer and use it in GitHub Desktop.
get recent media posted by a twitter user
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/bash | |
set -eu | |
set -o pipefail | |
screen_name=$1 | |
twurl "/1.1/statuses/user_timeline.json?screen_name=$screen_name&trim_user=true&exclude_replies=true&count=200&include_rts=false" | | |
jq -r '.[] | |
| select(.extended_entities.media != null) | |
| .id_str as $tweet_id | |
| .extended_entities.media | |
| .[] | |
| .id_str as $media_id | |
| ("curl \"" + .media_url_https + "\" -o \"" + $tweet_id + "_" + $media_id + ".jpg\"" )' | | |
bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment