# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 9
# self = https://watcher.sour.is/conv/p5z5aga
@lyse gron does something very similar with JSON. I used to use it more, but these days I just reach for jq instead.
@mckinley Woah, how cool is that!? :-D Thank you! <3 I'm sure gron will come in very handy some day, now that I have it in my tool bag. My jq skills are pretty much non-existent, though. I don't use it often enough.
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose. Just an array for each item containing all the values you need and pipe it to @tsv.


$ # Search YouTube using the Invidious API for "never gonna give you up" and write the results to out.json
$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)\tRick Astley\ttrue\tdQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]\tGlyphoricVibes\ttrue\tQdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up\tCSAA Insurance Group, a AAA Insurer\ttrue\tGtL1huin9EE
[...]
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose. Just an array for each item containing all the values you need and pipe it to the filter @tsv.


$ # Search YouTube using the Invidious API for "never gonna give you up" and write the results to out.json
$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)\tRick Astley\ttrue\tdQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]\tGlyphoricVibes\ttrue\tQdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up\tCSAA Insurance Group, a AAA Insurer\ttrue\tGtL1huin9EE
[...]
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose.


$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)\tRick Astley\ttrue\tdQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]\tGlyphoricVibes\ttrue\tQdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up\tCSAA Insurance Group, a AAA Insurer\ttrue\tGtL1huin9EE
[...]
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose.


$ # Search YouTube using the Invidious API for "never gonna give you up" and write the results to out.json
$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)\tRick Astley\ttrue\tdQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]\tGlyphoricVibes\ttrue\tQdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up\tCSAA Insurance Group, a AAA Insurer\ttrue\tGtL1huin9EE
[...]
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose. Just make an array for each item containing all the values you need and pipe it to the filter @tsv.


$ # Search YouTube using the Invidious API for "never gonna give you up" and write the results to out.json
$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)	Rick Astley	true	dQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]	GlyphoricVibes	true	QdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up	CSAA Insurance Group, a AAA Insurer	true	GtL1huin9EE
[...]
@lyse The thing that really unlocked jq for me was learning how to get a TSV output. That was a complete game changer, because it meant I could easily use it in a shell pipeline. I found it to be better than gron for that purpose. Just make an array for each item containing all the values you need and pipe it to the filter @tsv.


$ # Search YouTube using the Invidious API for "never gonna give you up" and write the results to out.json
$ curl -sGL -A 'Mozilla/5.0 (Linux; x86_64) Ladybird/1.0' -o out.json --data-urlencode 'q=never gonna give you up' 'https://farside.link/invidious/api/v1/search' 
$ jq -r '.[] | select(.type == "video") | [ .title, .author, .authorVerified, .videoId ] | @tsv' out.json
Rick Astley - Never Gonna Give You Up (Official Music Video)\tRick Astley\ttrue\tdQw4w9WgXcQ
Rick Astley - Never Gonna Give You Up [Lyrics]\tGlyphoricVibes\ttrue\tQdezFxHfatw
InsurAAAnce & Rick Astley Never Gonna Give You Up\tCSAA Insurance Group, a AAA Insurer\ttrue\tGtL1huin9EE
[...]
@mckinley I see. Once more fields are of interest, this is definitely the way to go.