tangled
alpha
login
or
join now
yoyle.city
/
skitpic
3
fork
atom
AT Protocol-powered Twitpic revival
atproto
express
typescript
photo-sharing
3
fork
atom
overview
issues
pulls
pipelines
lexicon update
lime360
3 weeks ago
012d3aeb
7de3ef69
+8
-2
3 changed files
expand all
collapse all
unified
split
lexicons
lol
skittr
skitpic
entry.json
src
lib
entry.ts
routes
main.ts
+5
lexicons/lol/skittr/skitpic/entry.json
···
20
20
"maxLength": 3000,
21
21
"maxGraphemes": 300
22
22
},
23
23
+
"sourceUrl": {
24
24
+
"type": "string",
25
25
+
"maxLength": 3000,
26
26
+
"maxGraphemes": 300
27
27
+
},
23
28
"createdAt": {
24
29
"type": "string",
25
30
"format": "datetime"
+2
-1
src/lib/entry.ts
···
1
1
import { AtpAgent } from "@atproto/api";
2
2
import { TID } from "@atproto/common-web";
3
3
4
4
-
export async function putEntry(agent: AtpAgent, did: string, image: any, alt: string) {
4
4
+
export async function putEntry(agent: AtpAgent, did: string, image: any, alt: string, sourceUrl?: string) {
5
5
const buffer = Buffer.from(image, "base64");
6
6
const blob = await agent.com.atproto.repo.uploadBlob(buffer);
7
7
const response = await agent.com.atproto.repo.putRecord({
···
17
17
size: blob.data.blob.size,
18
18
},
19
19
alt: alt,
20
20
+
sourceUrl: sourceUrl,
20
21
createdAt: new Date().toISOString()
21
22
}
22
23
});
+1
-1
src/routes/main.ts
···
35
35
}
36
36
37
37
try {
38
38
-
await putEntry(agent, did, image, alt);
38
38
+
await putEntry(agent, did, image, alt, url);
39
39
res.send("it works!");
40
40
} catch (error) {
41
41
console.log(error);