1.json
contains data retrieved from the Instagram API.data
is an array of media matching the query posted to Instagram's REST API, in a JSON array.- Each media element contains metadata for a photo/video posted to Instagram
.data[]
loops over each media object in the JSON file, letting us process each element|
works like a regular *nix pipe, taking the output of the previous operator and passing it on to the next one.select()
filters through objects depending on the rule passed to it..tags[]
returns an array of tags for each media.contains()
returns true if the current object passed to it contains the string passed as a parameter..tags[] | contains("100happydays")
iterates over all the tags associated with the media object and returns true if the current tag matches the string100happydays
..select( .tags[] | contains("100happydays") )
filters all media objects that contain the tag100happydays
.images.standard_resolution.url
now prints the value of theurl
inside thestandard_resolution
object contained in theimages
array, for each media thatselect
returned
Thus, we only print URLs for Instagram media containing the "100happydays" hashtag.
Hattip to ghost's extremely detailed explanation here