At first, extracting results into a file with:
# create a file needed
curl --globoff --silent "https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[browse]=blocks&request[page]=1&request[per_page]=400" | jq ".plugins[] | { name: .name, url: \"https://wordpress.org/plugins/\\(.slug)/\", short: .short_description, description: .description }" > wp-block-plugins.json
curl --globoff --silent "https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[browse]=blocks&request[page]=2&request[per_page]=400" | jq ".plugins[] | { name: .name, url: \"https://wordpress.org/plugins/\\(.slug)/\", short: .short_description, description: .description }" >> wp-block-plugins.json
Now, when I have file wp-block-plugins.json
, I can search for plugins I need:
# case in-sensitive search in description field for term 'accordion'
cat wp-block-plugins.json | jq '. | select(.description | test("\\baccordion\\b";"")) |{ name: .name, short: .short, url: .url }'
will get me desired results that look something like this, which is what I wanted in the first place:
...
{
"name": "Cosmic Blocks (40+) Content Editor Blocks Collection",
"short": "Blocks collection of 40+ customizable WordPress 5.0 gutenberg content blocks for the new content block…",
"url": "https://wordpress.org/plugins/cosmic-blocks/"
}
{
"name": "Hot Blocks",
"short": "A collection of several blocks for new WordPress editor (Gutenberg).",
"url": "https://wordpress.org/plugins/hot-blocks/"
}
...