Chromeの履歴からドメインを抽出
SQLite3を入れておく
code:shell
# ChromeのプロフィールはProfile 1だったり、Defaultだったり
mkdir /tmp/hoge
cd /tmp/hoge
cp ~/Library/Application\ Support/Google/Chrome/Profile\ 1/History ./
code:shell
sqlite3 History ".header on" ".mode tabs" "SELECT title, CASE WHEN url LIKE 'http%' THEN SUBSTR(REPLACE(REPLACE(url, 'https://', ''), 'http://', ''), 1, INSTR(REPLACE(REPLACE(url, 'https://', ''), 'http://', ''), '/')-1) ELSE url END as domain, count(1) as cnt FROM urls WHERE last_visit_time >= ( (strftime('%s','2025-08-01 00:00:00','localtime') + 11644473600) * 1000000 ) GROUP BY domain ORDER BY cnt;" 出力例
code:shell
sandbox - Google スプレッドシート docs.google.com 257
Sign in to GitHub · GitHub github.com 322
datadog app.datadoghq.com 627