From 8d5c1b118265a644fa1ba1ccffb9e9cf248f2e09 Mon Sep 17 00:00:00 2001 From: dholms Date: Fri, 19 May 2023 10:40:51 -0500 Subject: [PATCH] remove publishMany script --- scripts/publishMany.ts | 81 ------------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 scripts/publishMany.ts diff --git a/scripts/publishMany.ts b/scripts/publishMany.ts deleted file mode 100644 index ff96685..0000000 --- a/scripts/publishMany.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { AtpAgent, BlobRef } from '@atproto/api' -import fs from 'fs/promises' -import { ids } from '../src/lexicon/lexicons' - -const run = async () => { - const handle = 'bsky.app' - const password = 'abcd-1234-4321-dcba' // ask emily for app password - const feedGenDid = '' - - const agent = new AtpAgent({ service: 'https://bsky.social' }) - await agent.login({ identifier: handle, password }) - - await publishGen( - agent, - feedGenDid, - 'whats-hot', - `What's Hot`, - 'Top trending content from the whole network', - './whats-hot.jpg', - ) - - await publishGen( - agent, - feedGenDid, - 'hot-classic', - `What's Hot Classic`, - `The original What's Hot experience`, - './hot-classic.jpg', - ) - - await publishGen( - agent, - feedGenDid, - 'bsky-team', - `Bluesky Team`, - 'Posts from members of the Bluesky Team', - './bsky-team.jpg', - ) - - await publishGen( - agent, - feedGenDid, - 'with-friends', - `Popular With Friends`, - 'A mix of popular content from accounts you follow and content that your follows like.', - './with-friends.jpg', - ) - - console.log('All done 🎉') -} - -const publishGen = async ( - agent: AtpAgent, - feedGenDid: string, - recordName: string, - displayName: string, - description: string, - avatar: string, -) => { - let avatarRef: BlobRef | undefined - if (avatar) { - const img = await fs.readFile(avatar) - const blobRes = await agent.api.com.atproto.repo.uploadBlob(img) - avatarRef = blobRes.data.blob - } - - await agent.api.com.atproto.repo.putRecord({ - repo: agent.session?.did ?? '', - collection: ids.AppBskyFeedGenerator, - rkey: recordName, - record: { - did: feedGenDid, - displayName: displayName, - description: description, - avatar: avatarRef, - createdAt: new Date().toISOString(), - }, - }) -} - -run()