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
"maxLength": 3000,
21
"maxGraphemes": 300
22
},
0
0
0
0
0
23
"createdAt": {
24
"type": "string",
25
"format": "datetime"
···
20
"maxLength": 3000,
21
"maxGraphemes": 300
22
},
23
+
"sourceUrl": {
24
+
"type": "string",
25
+
"maxLength": 3000,
26
+
"maxGraphemes": 300
27
+
},
28
"createdAt": {
29
"type": "string",
30
"format": "datetime"
+2
-1
src/lib/entry.ts
···
1
import { AtpAgent } from "@atproto/api";
2
import { TID } from "@atproto/common-web";
3
4
-
export async function putEntry(agent: AtpAgent, did: string, image: any, alt: string) {
5
const buffer = Buffer.from(image, "base64");
6
const blob = await agent.com.atproto.repo.uploadBlob(buffer);
7
const response = await agent.com.atproto.repo.putRecord({
···
17
size: blob.data.blob.size,
18
},
19
alt: alt,
0
20
createdAt: new Date().toISOString()
21
}
22
});
···
1
import { AtpAgent } from "@atproto/api";
2
import { TID } from "@atproto/common-web";
3
4
+
export async function putEntry(agent: AtpAgent, did: string, image: any, alt: string, sourceUrl?: string) {
5
const buffer = Buffer.from(image, "base64");
6
const blob = await agent.com.atproto.repo.uploadBlob(buffer);
7
const response = await agent.com.atproto.repo.putRecord({
···
17
size: blob.data.blob.size,
18
},
19
alt: alt,
20
+
sourceUrl: sourceUrl,
21
createdAt: new Date().toISOString()
22
}
23
});
+1
-1
src/routes/main.ts
···
35
}
36
37
try {
38
-
await putEntry(agent, did, image, alt);
39
res.send("it works!");
40
} catch (error) {
41
console.log(error);
···
35
}
36
37
try {
38
+
await putEntry(agent, did, image, alt, url);
39
res.send("it works!");
40
} catch (error) {
41
console.log(error);