-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35ebabb
commit feaea4c
Showing
1 changed file
with
24 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
sqlite3 badger.sqlite3 -batch "SELECT browser.name, | ||
no_blocking, | ||
num_sites, | ||
COUNT(DISTINCT blocked_trackers.tracker_id) num_blocked, | ||
((CAST(STRFTIME('%s', end_time) AS INT) - CAST(STRFTIME('%s', start_time) AS INT)) / 60 / 60), | ||
start_time | ||
FROM scan | ||
JOIN browser ON browser.id = scan.browser_id | ||
JOIN (SELECT scan.id AS scan_id, | ||
tr.tracker_id | ||
FROM scan | ||
JOIN browser ON browser.id = scan.browser_id | ||
JOIN tracking tr ON tr.scan_id = scan.id | ||
WHERE scan.daily_scan = 1 | ||
AND scan.start_time > DATETIME('now', '-30 day') | ||
GROUP BY tr.scan_id, tr.tracker_id | ||
HAVING COUNT(DISTINCT tr.site_id) > 2) | ||
AS blocked_trackers ON blocked_trackers.scan_id = scan.id | ||
WHERE scan.daily_scan = 1 | ||
AND scan.start_time > DATETIME('now', '-30 day') | ||
GROUP BY scan_id | ||
ORDER BY scan.start_time DESC" | column -s '|' -t |