# uses https://github.com/embano1/tw, JSON output stored in file for faster processing
$ tw -f tw.json likes >Downloads/twout.json
# filter only youtube videos and print tweet text
$ cat twout.json | jq '.[]|select( .entities.urls[].expanded_url | contains ("yout"))|.full_text,"----"'
Last active
August 23, 2020 17:01
-
-
Save embano1/1631a6d44eaa7a934807ec80c7cc74e0 to your computer and use it in GitHub Desktop.
jq to filter youtube videos from Twitter likes (uses "tw")
Find the last 10 tweets and print their .full_text
jq '.[:10]|.[].full_text' Downloads/twout.json
...
# including some dash separators
jq '.[:10]|.[]|.full_text,"----"' Downloads/twout.json
...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blog post examples:
#1 Only print Tweets containing "String" (ignore case)
#2 Only find Tweets with these "two" "Words" (ignore case and order)
#3 Only print "Field(s)" we're interested in
#4 Filter for Tweets with Links to Youtube videos