Skip to content

Instantly share code, notes, and snippets.

@embano1
Last active August 23, 2020 17:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save embano1/1631a6d44eaa7a934807ec80c7cc74e0 to your computer and use it in GitHub Desktop.
Save embano1/1631a6d44eaa7a934807ec80c7cc74e0 to your computer and use it in GitHub Desktop.
jq to filter youtube videos from Twitter likes (uses "tw")
# 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,"----"'
@embano1
Copy link
Author

embano1 commented Sep 29, 2018

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