tangled
alpha
login
or
join now
yoyle.city
/
skittr
6
fork
atom
this repo has no description
atproto
bluesky
typescript
express
6
fork
atom
overview
issues
3
pulls
pipelines
pagination improvements
lime360
4 months ago
bf5b4bf6
1cb18b12
1/1
test.yml
success
24s
+13
-7
3 changed files
expand all
collapse all
unified
split
src
lib
misc.ts
routes
main.ts
mobile.ts
+5
-3
src/lib/misc.ts
···
1
1
import { AtpAgent } from "@atproto/api";
2
2
3
3
-
export async function getTimeline(agent: AtpAgent) {
4
4
-
const response = await agent.getTimeline();
5
5
-
return response.data.feed;
3
3
+
export async function getTimeline(agent: AtpAgent, cursor?: string) {
4
4
+
const response = await agent.getTimeline({
5
5
+
cursor: cursor,
6
6
+
});
7
7
+
return response.data;
6
8
}
7
9
8
10
export async function searchActors(agent: AtpAgent, q: string) {
+4
-2
src/routes/main.ts
···
44
44
});
45
45
46
46
router.get("/home", auth, async (req: Request, res: Response) => {
47
47
+
const cursor = (req.query.cursor as string) || "";
47
48
const handle = req.cookies.handle;
48
49
const did = await getActorDid(agent, handle);
49
50
const actor = await getActor(agent, did);
50
50
-
const feed = await getTimeline(agent);
51
51
+
const feed = await getTimeline(agent, cursor);
51
52
const follows = await getActorFollows(agent, did);
52
53
const { theme, bg } = await loadTheme(agent, did);
53
54
···
55
56
layout: "main",
56
57
title: "Bluesky / Home",
57
58
actor: actor,
58
58
-
feed: feed,
59
59
+
feed: feed.feed,
60
60
+
cursor: feed.cursor,
59
61
follows: follows,
60
62
usertheme: theme,
61
63
bg: bg,
+4
-2
src/routes/mobile.ts
···
30
30
});
31
31
32
32
mobile.get("/home", auth, async (req: Request, res: Response) => {
33
33
-
const feed = await getTimeline(agent);
33
33
+
const cursor = (req.query.cursor as string) || "";
34
34
+
const feed = await getTimeline(agent, cursor);
34
35
35
36
res.render("mobile/home", {
36
37
layout: "mobile",
37
38
title: "Bluesky",
38
38
-
feed: feed,
39
39
+
feed: feed.feed,
40
40
+
cursor: feed.cursor,
39
41
curuser: req.cookies.handle,
40
42
year: new Date().getFullYear(),
41
43
});