#!/usr/bin/env xq -f # Scan a HTML document for certain info and compile a JSON structure with # findings
def getProperty(id): map(select(."@property" == id))|first|."@content" ;
[ "og:url", "og:title", "og:description" ] as $propIds | .html.head.meta | map( select( [."@property"] | inside($propIds) )) | { url: getProperty("og:url"), title: getProperty("og:title"), description: getProperty("og:description") }