Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS queries #128

Merged
merged 3 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sql/2019/02_CSS/02_10.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#standardSQL
# 02_10: Top CSS libraries
SELECT
_TABLE_SUFFIX AS client,
app AS library,
COUNT(0) AS freq,
total,
ROUND(COUNT(0) * 100 / total, 2) AS pct
FROM
`httparchive.technologies.2019_07_01_*`
JOIN (
SELECT _TABLE_SUFFIX, COUNT(0) AS total
FROM `httparchive.summary_pages.2019_07_01_*`
GROUP BY _TABLE_SUFFIX)
USING (_TABLE_SUFFIX)
WHERE
app IN ('animate.css', 'Ant Design', 'Bootstrap', 'Bulma', 'Clarity', 'ZURB Foundation',
'Angular Material', 'Material Design Lite', 'Materialize CSS',
'Milligram', 'Pure CSS', 'Semantic-ui', 'Shapecss', 'tailwindcss', 'UIKit')
GROUP BY
client,
total,
library
ORDER BY
freq / total DESC
25 changes: 25 additions & 0 deletions sql/2019/02_CSS/02_11.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#standardSQL
# 02_11: Top reset utils
SELECT
client,
CASE LOWER(util)
WHEN 'normalize.css' THEN 'Normalize.css'
WHEN 'pure-css' THEN 'Pure CSS'
WHEN 'http://meyerweb.com/eric/tools/css/reset/' THEN 'Reset CSS'
ELSE util
END AS util,
COUNT(DISTINCT page) AS freq,
total,
ROUND(COUNT(DISTINCT page) * 100 / total, 2) AS pct
FROM
(SELECT client, page, body FROM `httparchive.almanac.summary_response_bodies` WHERE type = 'css')
JOIN
(SELECT _TABLE_SUFFIX AS client, COUNT(0) AS total FROM `httparchive.summary_pages.2019_07_01_*` GROUP BY client)
USING (client),
UNNEST(REGEXP_EXTRACT_ALL(body, '(?i)(normalize\\.css|pure\\-css|http://meyerweb\\.com/eric/tools/css/reset/)')) AS util
rviscomi marked this conversation as resolved.
Show resolved Hide resolved
GROUP BY
client,
total,
util
ORDER BY
freq / total DESC