-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cooing-swallow
- Loading branch information
Showing
5 changed files
with
167 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
const stagingTables = ['pages', 'requests', 'parsed_css'] | ||
for (const table of stagingTables) { | ||
// Staging tables source: https://github.com/HTTPArchive/crawl/blob/main/crawl.py | ||
['pages', 'requests', 'parsed_css'].forEach(table => | ||
declare({ | ||
schema: 'crawl_staging', | ||
name: table | ||
}) | ||
} | ||
) | ||
|
||
declare({ | ||
schema: 'wappalyzer', | ||
name: 'apps' | ||
}) | ||
// See https://github.com/HTTPArchive/dataform/issues/43 | ||
assert('corrupted_technology_values') | ||
.tags(['crawl_complete']) | ||
.query(ctx => ` | ||
SELECT | ||
date, | ||
client, | ||
tech, | ||
COUNT(DISTINCT page) AS cnt_pages, | ||
ARRAY_AGG(DISTINCT page LIMIT 3) AS sample_pages | ||
FROM ${ctx.ref('crawl_staging', 'pages')} AS pages | ||
LEFT JOIN pages.technologies AS tech | ||
LEFT JOIN tech.categories AS category | ||
WHERE | ||
date = '${constants.currentMonth}' AND | ||
( | ||
tech.technology NOT IN (SELECT DISTINCT name FROM wappalyzer.technologies) | ||
OR category NOT IN (SELECT DISTINCT name FROM wappalyzer.categories) | ||
OR ARRAY_LENGTH(tech.categories) = 0 | ||
) | ||
GROUP BY | ||
date, | ||
client, | ||
tech | ||
ORDER BY cnt_pages DESC | ||
`); | ||
|
||
// Wappalyzer tables source: https://github.com/HTTPArchive/wappalyzer/blob/main/.github/workflows/upload.yml | ||
['technologies', 'categories'].forEach(table => | ||
declare({ | ||
schema: 'wappalyzer', | ||
name: table | ||
}) | ||
) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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