Skip to content

Instantly share code, notes, and snippets.

@boly38
Last active May 27, 2024 15:37
Show Gist options
  • Save boly38/1766ce67bb75d78c431fc51cbe016573 to your computer and use it in GitHub Desktop.
Save boly38/1766ce67bb75d78c431fc51cbe016573 to your computer and use it in GitHub Desktop.
bluesky my first automated post
// from : https://github.com/boly38/botEnSky/issues/1
import {BskyAgent} from '@atproto/api'
const identifier = process.env.BLUESKY_EMAIL;
const password = process.env.BLUESKY_PASSWORD;
const service = "https://api.bsky.social";
const agent = new BskyAgent({service})
await agent.login({identifier, password});
const text = "Hey ! Ceci est un Post de PoC (fichier js de 8 lignes) & sera le seul test sur ce compte #bluesky #api #bot https://docs.bsky.app/docs/get-started";
await agent.post({text, createdAt: new Date().toISOString()}).then(console.log).catch(console.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment