Detect and parse the snapshot JSON from a Facebook Ad Library script tag
Source:R/get_media.R
detectmysnap.RdFacebook's SSR script tags contain a bundle of many ads' snapshot data.
This function locates the "snapshot": occurrence that belongs to the
requested ad_id by first finding the ad_id in the raw text and then
extracting the nearest "snapshot": JSON object after it.
See also
get_ad_snapshots() which calls this function internally.