summaryrefslogtreecommitdiff
path: root/cookiebanners/screen/y.sh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-11-14 21:07:26 +0100
committerJonas Smedegaard <dr@jones.dk>2024-11-14 21:07:26 +0100
commit02a5d8ebcc0e2a4d434a453a98919b5ccb53dac0 (patch)
tree48d08575679fde46b71b0c634f42cb667ab63f5b /cookiebanners/screen/y.sh
parent194fe2e0be5bd2e02342431000fabb995489e787 (diff)
drop duplicate script and domain listHEADmain
Diffstat (limited to 'cookiebanners/screen/y.sh')
-rwxr-xr-xcookiebanners/screen/y.sh52
1 files changed, 0 insertions, 52 deletions
diff --git a/cookiebanners/screen/y.sh b/cookiebanners/screen/y.sh
deleted file mode 100755
index 019193a..0000000
--- a/cookiebanners/screen/y.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-# break on error
-set -eu
-
-# top 1000 domains
-# * go to <https://dataforseo.com/free-seo-stats/top-1000-websites>
-# * select "Denmark"
-# * download
-json_file="ranked_domains.json"
-
-# count Firefox windows
-firefox_windows() {
- swaymsg -t get_tree | jq '[recurse(.nodes[]? | .nodes[]?)] | map(select(.app_id == "firefox-esr")) | length'
-}
-
-# count already opened Firefox windows
-baseline_windows=$(firefox_windows)
-
-# iterate through top domains and collect data about each
-jq -c '.[]' "$json_file" | while read -r item; do
- domain=$(echo "$item" | jq -r '.domain')
- pos=$(echo "$item" | jq -r '.position')
-
- # skip if screenshot already exist for this domain
- [ ! -e "$pos.png" ] || continue
-
- # load front page of www host at domain into Firefox
- firefox --new-window "https://www.$domain"
-
- # wait until firefox window is closed
- while true; do
- sleep 1
- if [ "$(firefox_windows)" -eq "$baseline_windows" ]; then
- break
- fi
- done
-
- # collect PNG screenshot
- # * use tool grimshot
- find ~/ -mindepth 1 -maxdepth 1 -name '*.png' -exec mv '{}' "$pos.png" ';'
-
- # collect HAR network timing data
- # * Open debugger window: F12
- # * Select pane "Network"
- # * From rightmost pane, select "Save all as HAR"
- find ~/data -mindepth 1 -maxdepth 1 -name '*.har' -exec mv '{}' "$pos.har" ';'
-
- # collect data: PNG screenshot, HAR network timing and PDF screenshot
- # * use plugin <https://addons.mozilla.org/da/firefox/addon/save-pdf/>
- find ~/data -mindepth 1 -maxdepth 1 -name '*' -exec mv '{}' "$pos.pdf" ';'
-done