Last active
October 6, 2022 17:09
-
-
Save bgrins/526a7ea4c8ec46391e940d65454b0529 to your computer and use it in GitHub Desktop.
potential-pwas-httparchive
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
CREATE OR REPLACE TABLE `httparchive-sandbox.test.possible_pwas_mobile` AS | |
SELECT url, ServiceWorker, manifests FROM | |
( | |
SELECT | |
url, | |
IF(JSON_EXTRACT(payload, '$._pwa.serviceWorkerHeuristic') = 'true', 1, 0) AS ServiceWorker, | |
IF(JSON_EXTRACT(payload, '$._pwa.manifests') != '[]' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}', 1, 0) AS manifests | |
FROM | |
`httparchive.pages.2022_06_01_mobile` | |
); | |
CREATE OR REPLACE TABLE `httparchive-sandbox.test.possible_pwas_desktop` AS | |
SELECT url, ServiceWorker, manifests FROM | |
( | |
SELECT | |
url, | |
IF(JSON_EXTRACT(payload, '$._pwa.serviceWorkerHeuristic') = 'true', 1, 0) AS ServiceWorker, | |
IF(JSON_EXTRACT(payload, '$._pwa.manifests') != '[]' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}' AND JSON_EXTRACT(payload, '$._pwa.manifests') != '{}', 1, 0) AS manifests | |
FROM | |
`httparchive.pages.2022_06_01_desktop` | |
); | |
SELECT COUNT(*) FROM `httparchive-sandbox.test.possible_pwas_desktop` WHERE ServiceWorker=1 and manifests=1; | |
SELECT COUNT(*) FROM `httparchive-sandbox.test.possible_pwas_desktop`; | |
SELECT COUNT(*) FROM `httparchive-sandbox.test.possible_pwas_mobile` WHERE ServiceWorker=1 and manifests=1; | |
SELECT COUNT(*) FROM `httparchive-sandbox.test.possible_pwas_mobile`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment