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