A simple AtProto app to read pet.mewsse.link records on my PDS.

Fix embedding, update envs and add compose file

Mewsse 079db693 d5095a3b

Changed files
+25 -5
src
+3 -1
.env.example
···
DB_PATH=":memory:"
DID="did:plc:you_did_here"
-
LOG_LEVEL="INFO"
+
LOG_LEVEL="INFO"
+
ITEM_PER_PAGES="10"
+
PORT="8080"
+18
compose.yml
···
+
services:
+
links:
+
container_name: links
+
build: .
+
restart: unless-stopped
+
environment:
+
DB_PATH: "/links/db.db"
+
DID: "did:plc:w7x22x56pgtta23uulbcahbo"
+
LOG_LEVEL: "INFO"
+
ITEM_PER_PAGES: 10
+
PORT: "8080"
+
volumes:
+
- type: bind
+
source: ./links
+
target: /links
+
ports:
+
- 8080:8080
+
+4 -4
src/ingester.ts
···
for await (const entry of repo) {
if (!repoRev) repoRev = entry.rkey
if (entry.collection != "pet.mewsse.link") continue
+
const link = decode(entry.bytes)
-
console.log(link)
+
const embed = await findEmbed(did, pds, link.embed)
links.push({
rkey: entry.rkey,
url: link.url,
title: link.title,
description: link.description,
-
embed: await findEmbed(did, pds, link.embed),
+
embed: embed,
nsfw: +(link.nsfw || 0),
createdAt: link.createdAt
})
···
links = links.sort((a, b) => a.createdAt > b.createdAt ? 1 : -1)
for await (const link of links) {
-
const embed = await findEmbed(did, pds, link.embed)
await db
.insertInto('links')
.values(link)
···
url: link.url,
title: link.title,
description: link.description,
-
embed: embed,
+
embed: link.embed,
nsfw: +(link.nsfw || 0),
})
)