Skip to content

Instantly share code, notes, and snippets.

@igrigorik

igrigorik/ha.sql Secret

Created June 4, 2015 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igrigorik/e7676cda3a07f8365360 to your computer and use it in GitHub Desktop.
Save igrigorik/e7676cda3a07f8365360 to your computer and use it in GitHub Desktop.
/*
To reproduce, follow instructions at:
http://bigqueri.es/t/analyzing-html-css-and-javascript-response-bodies/442
*/
/* 5,790,260 results */
SELECT count(url)
FROM [httparchive:runs.2014_08_15_requests_body]
WHERE mimeType CONTAINS 'html'
OR mimeType CONTAINS 'javascript'
OR mimeType CONTAINS 'text'
/* 733 results */
SELECT host(url) as host, worker, url
FROM (
SELECT url,
REGEXP_EXTRACT(body, r'(new Worker\([^)]*\))') as worker
FROM [httparchive:runs.2014_08_15_requests_body]
)
WHERE worker IS NOT NULL
GROUP by url, host, worker
/* 315 result */
SELECT host(url) as host, worker, url, body
FROM (
SELECT url, body,
REGEXP_EXTRACT(body, r'(new SharedWorker\([^)]*\))') as worker
FROM [httparchive:runs.2014_08_15_requests_body]
)
WHERE worker IS NOT NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment