Add unpublishFeedGen script (#77)
Co-authored-by: Hailey <hailey@blueskyweb.xyz>
This commit is contained in:
parent
7ae4f0e214
commit
437315b4cd
2 changed files with 40 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"publishFeed": "ts-node scripts/publishFeedGen.ts",
|
||||
"unpublishFeed": "ts-node scripts/unpublishFeedGen.ts",
|
||||
"start": "ts-node src/index.ts",
|
||||
"build": "tsc"
|
||||
},
|
||||
|
|
39
scripts/unpublishFeedGen.ts
Normal file
39
scripts/unpublishFeedGen.ts
Normal file
|
@ -0,0 +1,39 @@
|
|||
import dotenv from 'dotenv'
|
||||
import { AtpAgent, BlobRef } from '@atproto/api'
|
||||
import fs from 'fs/promises'
|
||||
import { ids } from '../src/lexicon/lexicons'
|
||||
|
||||
const run = async () => {
|
||||
dotenv.config()
|
||||
|
||||
// YOUR bluesky handle
|
||||
// Ex: user.bsky.social
|
||||
const handle = ''
|
||||
|
||||
// YOUR bluesky password, or preferably an App Password (found in your client settings)
|
||||
// Ex: abcd-1234-efgh-5678
|
||||
const password = ''
|
||||
|
||||
// A short name for the record that will show in urls
|
||||
// Lowercase with no spaces.
|
||||
// Ex: whats-hot
|
||||
const recordName = ''
|
||||
|
||||
// -------------------------------------
|
||||
// NO NEED TO TOUCH ANYTHING BELOW HERE
|
||||
// -------------------------------------
|
||||
|
||||
// only update this if in a test environment
|
||||
const agent = new AtpAgent({ service: 'https://bsky.social' })
|
||||
await agent.login({ identifier: handle, password })
|
||||
|
||||
await agent.api.com.atproto.repo.deleteRecord({
|
||||
repo: agent.session?.did ?? '',
|
||||
collection: ids.AppBskyFeedGenerator,
|
||||
rkey: recordName,
|
||||
})
|
||||
|
||||
console.log('All done 🎉')
|
||||
}
|
||||
|
||||
run()
|
Loading…
Add table
Add a link
Reference in a new issue