this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove publishMany script

dholms 8d5c1b11 2f620bd4

-81
-81
scripts/publishMany.ts
··· 1 - import { AtpAgent, BlobRef } from '@atproto/api' 2 - import fs from 'fs/promises' 3 - import { ids } from '../src/lexicon/lexicons' 4 - 5 - const run = async () => { 6 - const handle = 'bsky.app' 7 - const password = 'abcd-1234-4321-dcba' // ask emily for app password 8 - const feedGenDid = '' 9 - 10 - const agent = new AtpAgent({ service: 'https://bsky.social' }) 11 - await agent.login({ identifier: handle, password }) 12 - 13 - await publishGen( 14 - agent, 15 - feedGenDid, 16 - 'whats-hot', 17 - `What's Hot`, 18 - 'Top trending content from the whole network', 19 - './whats-hot.jpg', 20 - ) 21 - 22 - await publishGen( 23 - agent, 24 - feedGenDid, 25 - 'hot-classic', 26 - `What's Hot Classic`, 27 - `The original What's Hot experience`, 28 - './hot-classic.jpg', 29 - ) 30 - 31 - await publishGen( 32 - agent, 33 - feedGenDid, 34 - 'bsky-team', 35 - `Bluesky Team`, 36 - 'Posts from members of the Bluesky Team', 37 - './bsky-team.jpg', 38 - ) 39 - 40 - await publishGen( 41 - agent, 42 - feedGenDid, 43 - 'with-friends', 44 - `Popular With Friends`, 45 - 'A mix of popular content from accounts you follow and content that your follows like.', 46 - './with-friends.jpg', 47 - ) 48 - 49 - console.log('All done 🎉') 50 - } 51 - 52 - const publishGen = async ( 53 - agent: AtpAgent, 54 - feedGenDid: string, 55 - recordName: string, 56 - displayName: string, 57 - description: string, 58 - avatar: string, 59 - ) => { 60 - let avatarRef: BlobRef | undefined 61 - if (avatar) { 62 - const img = await fs.readFile(avatar) 63 - const blobRes = await agent.api.com.atproto.repo.uploadBlob(img) 64 - avatarRef = blobRes.data.blob 65 - } 66 - 67 - await agent.api.com.atproto.repo.putRecord({ 68 - repo: agent.session?.did ?? '', 69 - collection: ids.AppBskyFeedGenerator, 70 - rkey: recordName, 71 - record: { 72 - did: feedGenDid, 73 - displayName: displayName, 74 - description: description, 75 - avatar: avatarRef, 76 - createdAt: new Date().toISOString(), 77 - }, 78 - }) 79 - } 80 - 81 - run()