📝 lurkers_month.mdv4.7.4 · 2026-11-20

lurkers_month.sh — manual

What it does

It reads the saved daily lurker reports (output of lurkers.sh -t, one file per day) and adds up their section 3, "WHAT THEY LOOKED AT", over a whole month. It ignores the rest of each daily report and reads no logs and no database. It is read-only and run by hand.

Its report has two parts:

Usage

lurkers_month.sh lurkers_202611* > lurkers_month_202611
lurkers_month.sh -h

Limits — read before trusting a number

Behaviour rules (the automated test checks against these)

Rule Behaviour
R1 Read-only. It reads only the report files it is given, with no logs or database.
R2 It uses only section 3 (from == 3. WHAT THEY LOOKED AT to How to read a guest row:, the next == heading or end of file). Progress lines ([hh:mm:ss] ...) and (...) notes are ignored.
R3 It skips, and names in the heading: ALL WEEK reports; a second report for a day it has already read; files with no section 3 (including empty files).
R4 One daily report counts as one day. The day comes from TODAY ONLY: DD/Mon/YYYY, otherwise from the YYYYMMDD in the file name (not from folder names). The heading shows the number of days and the first and last day.
R5 Reader totals are the daily count lines added up. Both layouts are read: v1.1.0 (N topic pages, ...) and v1.2.0 (N views of M topics, K next/prev-topic clicks, ...). Windows line ends are accepted.
R6 A topic is its [Board] Subject, with trailing spaces trimmed. Its views and attachment views are the daily Nx and +N attachment views added up. Readers and days are each counted once.
R7 Part A is sorted by views, then attachment views, then readers. It shows the first TOPICS topics and counts the rest.
R8 Part B lists readers with at least one topic view or attachment view, sorted by topic views, then attachment views, then other pages. Each reader gets its top TOPN topics for the month. Readers with neither are counted on one line, which names the first 10.
R9 It handles UTF-8 subjects and HTML entities (") exactly as the daily report prints them.
R10 It prints a version banner on stderr at start. -h prints the help. It exits 0 on success and 1 when no file is given, a file is unreadable, or no usable daily report is found.

lurkers_month_test.sh (in the same zip) builds its own sample reports, runs the script and checks rules R2 to R10 with 23 checks. It prints PASS/FAIL for each check and exits 0 only if all of them pass.

Pseudocode map (describes v1.0.0)

check args are readable files, else exit 1
one awk pass over all files:
per file: date := YYYYMMDD from file name (basename)
heading "ALL WEEK" -> mark week
heading "TODAY ONLY: d" -> date := d
"== 3. WHAT THEY LOOKED AT":
week? -> skip file "ALL WEEK report"
date already read -> skip file "same day as ..."
else count day, widen first/last date, enter section 3
in section 3:
end marker -> leave section 3
blank / [..] / (..) -> ignore
" Nx [Board] Subject [ +A attachment views]"
-> add N,A to topic and to reader+topic;
note reader and day against topic
"LABEL (counts)" -> current reader := LABEL; note day;
add topic views / next-prev / attach / other
end: any file never seen in section 3 -> skip "no section 3"
write days, heading lines, topics, readers, reader-topics
no usable day -> exit 1
print heading box, then
A: topics sorted -> first TOPICS rows, "(+N more)"
B: readers sorted; for each with views+attach > 0: totals line + top TOPN topics
others -> one counted line (first 10 named)
exit 0

Version history