Created
November 27, 2023 19:50
-
-
Save adamsilverstein/f5191f7787143082a19cc1baea4b5042 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%bigquery oembeds | |
WITH | |
WPEmbeds AS ( | |
SELECT | |
url, | |
JSON_EXTRACT(payload, '$._cms.wordpress.has_embed_block') AS has_embed_block, | |
CAST( JSON_EXTRACT(payload, '$._cms.wordpress.embed_block_count.total') AS FLOAT64 ) AS embed_block_count_total, | |
JSON_EXTRACT_ARRAY(payload, '$._cms.wordpress.embed_block_count.total_by_type') AS embed_block_count_total_by_type, | |
FROM `httparchive.pages.2023_10_01_*` | |
), | |
WordPressOrigins AS ( | |
SELECT COUNT(DISTINCT (url)) AS wordpress_origins | |
FROM `httparchive.technologies.2023_10_01_*` | |
WHERE app = 'WordPress' | |
), | |
CountedEmbeds AS ( | |
SELECT | |
COUNT( DISTINCT url ) AS origins, | |
COUNT( DISTINCT IF( has_embed_block="true", url, NULL ) ) AS has_embed, | |
AVG( embed_block_count_total ) as average_embed_block_count, | |
STDDEV( embed_block_count_total ) as stddev_embed_block_count, | |
FROM | |
WPEmbeds | |
) | |
SELECT | |
origins, | |
wordpress_origins, | |
has_embed, | |
has_embed/wordpress_origins * 100 AS embed_wp_percentage, | |
average_embed_block_count, | |
stddev_embed_block_count | |
FROM CountedEmbeds | |
CROSS JOIN WordPressOrigins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results