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
viewing threads complete
lime360
3 months ago
3a657485
462ced30
1/1
test.yml
success
26s
+37
-20
3 changed files
expand all
collapse all
unified
split
src
lib
misc.ts
routes
main.ts
views
status.hbs
+8
-1
src/lib/misc.ts
···
8
8
}
9
9
10
10
export async function searchActors(agent: AtpAgent, q: string) {
11
11
-
const response = await agent.app.bsky.actor.searchActors({
11
11
+
const response = await agent.searchActors({
12
12
q: q,
13
13
});
14
14
return response.data.actors;
15
15
}
16
16
+
17
17
+
export async function getPostThread(agent: AtpAgent, uri: string) {
18
18
+
const response = await agent.getPostThread({
19
19
+
uri: uri
20
20
+
});
21
21
+
return response.data.thread.post;
22
22
+
}
+23
-13
src/routes/main.ts
···
12
12
} from "../lib/actor.js";
13
13
import { getFeed, getFeedData } from "../lib/feed.js";
14
14
import { getTheme, loadTheme } from "../lib/theme.js";
15
15
-
import { getTimeline, searchActors } from "../lib/misc.js";
15
15
+
import { getTimeline, searchActors, getPostThread } from "../lib/misc.js";
16
16
17
17
import { getReviews } from "../reviews.js";
18
18
import { PUBLIC_URL } from "../env.js";
···
88
88
});
89
89
});
90
90
91
91
-
router.get(
92
92
-
"/profile/:handle/following",
93
93
-
async (req: Request, res: Response) => {
91
91
+
router.get("/profile/:handle/following", async (req: Request, res: Response) => {
94
92
const did = await getActorDid(pubagent, req.params.handle);
95
93
const actor = await getActor(pubagent, did);
96
94
const follows = await getActorFollows(pubagent, did);
···
109
107
},
110
108
);
111
109
112
112
-
router.get(
113
113
-
"/profile/:handle/followers",
114
114
-
async (req: Request, res: Response) => {
110
110
+
router.get("/profile/:handle/followers", async (req: Request, res: Response) => {
115
111
const did = await getActorDid(pubagent, req.params.handle);
116
112
const actor = await getActor(pubagent, did);
117
113
const follows = await getActorFollows(pubagent, did);
···
132
128
},
133
129
);
134
130
131
131
+
router.get("/profile/:handle/post/:tid", async (req: Request, res: Response) => {
132
132
+
const did = await getActorDid(pubagent, req.params.handle);
133
133
+
const actor = await getActor(pubagent, did);
134
134
+
const post = await getPostThread(pubagent, `at://${did}/app.bsky.feed.post/${req.params.tid}`);
135
135
+
const { theme, bg } = await loadTheme(agent, did);
136
136
+
137
137
+
res.render("status", {
138
138
+
layout: "main",
139
139
+
title: "Bluesky / " + actor.handle,
140
140
+
actor: actor,
141
141
+
post: post,
142
142
+
usertheme: theme,
143
143
+
bg: bg,
144
144
+
curuser: req.cookies.handle,
145
145
+
year: new Date().getFullYear(),
146
146
+
});
147
147
+
});
148
148
+
135
149
router.get("/tw/search", async (req: Request, res: Response) => {
136
150
const did = await getActorDid(agent, req.cookies.handle);
137
151
const { theme, bg } = await loadTheme(agent, did);
···
164
178
});
165
179
});
166
180
167
167
-
router.get(
168
168
-
"/profile/:handle/feed/:record",
169
169
-
async (req: Request, res: Response) => {
181
181
+
router.get("/profile/:handle/feed/:record", async (req: Request, res: Response) => {
170
182
const cursor = (req.query.cursor as string) || "";
171
183
const did = await getActorDid(pubagent, req.params.handle);
172
184
const feed = await getFeed(pubagent, did, req.params.record, cursor);
···
200
212
});
201
213
});
202
214
203
203
-
router.get(
204
204
-
"/profile/:handle/feed/:record/rss",
205
205
-
async (req: Request, res: Response) => {
215
215
+
router.get("/profile/:handle/feed/:record/rss", async (req: Request, res: Response) => {
206
216
const did = await getActorDid(pubagent, req.params.handle);
207
217
const feed = await getFeed(pubagent, did, req.params.record);
208
218
const feedData = await getFeedData(pubagent, did, req.params.record);
+6
-6
views/status.hbs
···
5
5
<div class="wrapper">
6
6
<div id="permalink">
7
7
<div class="desc">
8
8
-
<p>NyQuil sleep is not good sleep, but sleep nonetheless.</p>
8
8
+
<p>{{post.record.text}}</p>
9
9
<p class="meta">
10
10
<span class="meta">
11
11
-
10:58 AM February 03, 2007 from web
12
12
-
<span id="status_actions_5254943"> </span>
11
11
+
{{elapsed post.record.createdAt}}
12
12
+
<span id="status_actions_{{post.cid}}"> </span>
13
13
</span>
14
14
</p>
15
15
</div>
16
16
17
17
<h2 class="thumb">
18
18
-
<a href="https://web.archive.org/web/20070218034409/http://twitter.com/jack">
19
19
-
<img alt="Picture_2" src="#" />
18
18
+
<a href="../../{{post.author.handle}}">
19
19
+
<img alt="Picture_2" src="{{post.author.avatar}}" width="73" height="73" />
20
20
</a>
21
21
-
<a href="https://web.archive.org/web/20070218034409/http://twitter.com/jack">Jack Dorsey</a>
21
21
+
<a href="../../{{post.author.handle}}">{{post.author.displayName}}</a>
22
22
</h2>
23
23
</div>
24
24
</div>