Differences From
Artifact [7ed4c4752c]:
24 24 var time: lib.store.timepoint
25 25 if at:cmp('top') then
26 26 time = lib.osclock.time(nil)
27 27 else
28 28 var tp, ok = lib.math.decparse(at)
29 29 if ok then time = tp end
30 30 end
31 - lib.io.fmt('from-time: %llu\n', time)
32 31 var posts = co.srv:post_enum_author_uid(uid, lib.store.range {
33 32 mode = 1; -- time -> idx
34 33 from_time = time;
35 34 to_idx = 65;
36 35 })
37 36 var oldest = time
38 37 json:lpush',"partOf":"https://':ppush(co.srv.cfg.domain):ppush(path)
39 38 :lpush'","type":"CollectionPage","orderedItems":['
40 39 if posts.sz > 0 then defer posts:free()
41 40 for i=0, lib.math.smallest(posts.sz,64) do
42 41 if i~=0 then json:lpush',' end
43 42 json:ppush(lib.api.lp.tweet(co,posts(i).ptr,true))
44 43 oldest = lib.math.smallest(posts(i)().posted, oldest)
44 + posts(i):free()
45 45 end
46 46 end
47 47 json:lpush'],"totalItems":':ipush(posts.sz)
48 48 if oldest ~= time and oldest > 0 and posts.sz > 64 then
49 49 json:lpush',"next":"https://':ppush(co.srv.cfg.domain):ppush(path)
50 50 :lpush'?at=':ipush(oldest-1):lpush'"'
51 51 end