18 Not necessary for short format, because we have Unix head/tail,
19 but may be convinient for long format (because msg spans multiple lines).
20 - [-] Convert to Typed Racket
21 - [x] build executable (otherwise too-slow)
28 Discover new peers mentioned by known peers.
30 - see timeline ops above
34 - Watch FIFO for lines, then read, timestamp and append [+ upload].
35 Can be part of a "live" mode, along with background polling and
36 incremental printing. Sort of an ii-like IRC experience.
38 - see timeline ops above
39 - see hashtag and channels above
42 - [ ] all - use all known peers
43 - [ ] fast - all except peers known to be slow or unavailable
46 - calls user-configured command to upload user's own timeline file to their server
47 Looks like a better CLI parser than "racket/cmdline": https://docs.racket-lang.org/natural-cli/
48 But it is no longer necessary now that I've figured out how to chain (command-line ..) calls.
55 - [-] parse peer refs from peer timelines
56 - [x] mentions from timeline messages
57 - [x] @<source.nick source.url>
59 - [ ] "following" from timeline comments: # following = <nick> <uri>
60 - [ ] Parse User-Agent web access logs.
61 - [-] Update peer ref file(s)
64 - [ ] peers-followed (by others, parsed from comments)
65 - [ ] peers-down (net errors)
67 Rough sketch from late 2019:
70 let write file peers =
73 (* Fetch could mean either or both of:
74 * - fetch peer's we-are-twtxt.txt
75 * - fetch peer's twtxt.txt and extract mentioned peer URIs
80 let rec discover peers_old =
82 Set.fold peers_old ~init:peers_old ~f:(fun peers p ->
85 (* TODO: Should p be moved to down set here? *)
89 Set.union peers peers_fetched
92 if Set.empty (Set.diff peers_old peers_all) then
96 let rec loop interval peers_old =
97 let peers_all = discover peers_old in
98 let (peers_up, peers_down) = test peers_all in
99 write "peers-all.txt" peers_all;
100 write "peers-up.txt" peers_up;
101 write "peers-down.txt" peers_down;
103 loop interval peers_all
105 loop (Sys.argv.(1)) (read "peers-all.txt")
109 - [ ] Support date without time in timestamps
110 - [ ] Crawl all cache/objects/*, not given peers.
111 BUT, in order to build A-mentioned-B graph, we need to know the nick
112 associated with the URI whos object we're examining. How to do that?
113 - [ ] Crawl downloaded web access logs
114 - [ ] download-command hook to grab the access logs
116 (define (parse log-line)
117 (match (regexp-match #px"([^/]+)/([^ ]+) +\\(\\+([a-z]+://[^;]+); *@([^\\)]+)\\)" log-line)
118 [(list _ client version uri nick) (cons nick uri)]
121 (list->set (filter-map parse (file->lines "logs/combined-access.log")))
123 (filter (λ (p) (equal? 'file (file-or-directory-type p))) (directory-list logs-dir))
125 - [ ] user-agent file as CLI option - need to run at least the crawler as another user
126 - [ ] Support fetching rsync URIs
127 - [ ] Check for peer duplicates:
128 - [ ] same nick for N>1 URIs
129 - [ ] same URI for N>1 nicks
130 - [ ] Background polling and incremental timeline updates.
131 We can mark which messages have already been printed and print new ones as
134 - [ ] Polling mode/command, where tt periodically polls peer timelines
135 - [ ] nick tiebreaker(s)
136 - [ ] some sort of a hash of URI?
137 - [ ] angry-purple-tiger kind if thingie?
138 - [ ] P2P nick registration?
139 - [ ] Peers vote by claiming to have seen a nick->uri mapping?
140 The inherent race condition would be a feature, since all user name
141 registrations are races.
144 - [ ] download times per peer
145 - [ ] Support redirects
146 - should permanent redirects update the peer ref somehow?
147 - [ ] optional text wrap
149 - [ ] peer refs set operations (perhaps better done externally?)
150 - [ ] timeline as a result of a query (peer ref set op + filter expressions)
152 - [ ] highlight mentions
153 - [ ] filter on mentions
154 - [ ] highlight hashtags
155 - [ ] filter on hashtags
156 - [ ] hashtags as channels? initial hashtag special?
158 - [ ] console logger colors by level ('error)
159 - [ ] file logger ('debug)
160 - [ ] Suport immutable timelines
161 - store individual messages
163 - something like DBM or SQLite - faster
164 - filesystem - transparent, easily published - probably best
165 - [ ] block(chain/tree) of twtxts
166 - distributed twtxt.db
167 - each twtxt.txt is a ledger
168 - peers can verify states of ledgers
169 - peers can publish known nick->url mappings
170 - peers can vote on nick->url mappings
171 - we could break time periods into blocks
172 - how to handle the facts that many(most?) twtxt are unseen by peers
177 - [x] Support time ranges (i.e. reading the timeline between given time points)
178 - [x] Dedup read-in peers before using them.
179 - [x] Prevent redundant downloads
181 - [x] Check Last-Modified if no ETag was provided
182 - [x] Parse rfc2822 timestamps
183 - [x] caching (use cache by default, unless explicitly asked for update)
184 - [x] value --> cache
185 - [x] value <-- cache
187 - [x] Logger sync before exit.
188 - [x] Implement rfc3339->epoch
189 - [x] Remove dependency on rfc3339-old
190 - [x] remove dependency on http-client
191 - [x] Build executable
192 Implies fix of "collection not found" when executing the built executable
193 outside the source directory:
195 collection-path: collection not found
197 in collection directories:
199 /usr/share/racket/collects/racket/private/collect.rkt:11:53: fail
200 /usr/share/racket/collects/setup/getinfo.rkt:17:0: get-info
201 /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
202 /usr/share/racket/collects/racket/cmdline.rkt:191:51
208 - [~] named timelines/peer-sets
209 REASON: That is basically files of peers, which we already support.