From bae7cf52d8256d4be2f142c387870aca783489cc Mon Sep 17 00:00:00 2001 From: unytics Date: Wed, 30 Aug 2023 18:59:11 +0200 Subject: [PATCH] new function: get_webpage_structured_data --- bigfunctions/get_webpage_structured_data.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bigfunctions/get_webpage_structured_data.yaml diff --git a/bigfunctions/get_webpage_structured_data.yaml b/bigfunctions/get_webpage_structured_data.yaml new file mode 100644 index 00000000..32c8ee13 --- /dev/null +++ b/bigfunctions/get_webpage_structured_data.yaml @@ -0,0 +1,27 @@ +type: function_sql +category: get_data +author: + name: Paul Marcombes + url: https://www.linkedin.com/in/paul-marcombes + avatar_url: "https://lh3.googleusercontent.com/a-/ACB-R5RDf2yxcw1p_IYLCKmiUIScreatDdhG8B83om6Ohw=s260" +description: | + Get webpage Structured Data + that [Google shows in search results](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data). +arguments: + - name: url + type: string +output: + name: structured_data + type: json +examples: + - description: "" + arguments: + - "'https://apps.apple.com/fr/app/nickel-compte-pour-tous/id1119225763'" + output: "{...}" +code: | + parse_json( + regexp_extract( + {BIGFUNCTIONS_DATASET}.get(url, null), + r'application/ld\+json[^>]*>([^<]*)' + ) + )