Skip to content

Basic Bluesky / atproto library for apps script; post from your Doc or Spreadsheet!

License

Notifications You must be signed in to change notification settings

softplus/bluesky-appsscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

bluesky-appsscript

Basic Bluesky / atproto library for apps script; post from your Doc or Spreadsheet!

Setup

  1. Create a new file in your apps script, call it 'bluesky' (it'll be labeled 'bluesky.gs' after saving)
  2. Copy bluesky.gs from here into your file
  3. Done.

Usage

Strong recommendation: create a test account and use app passwords. Don't test with your actual account. It's much harder to clean up and rate limits will be annoying.

Sample code:

const BLUESKY_HANDLE = 'whatever.bsky.social';
const BLUESKY_APP_PASSWORD = 'abcd-1234-123x-yzzy';
const bsky = Bluesky; // (or whatever your namespace is for bluesky.gs)
if (!bsky.login(BLUESKY_HANDLE, BLUESKY_APP_PASSWORD)) {console.log("Can't log in"); return;}
let post = bsky.pd_AddText(false, 'This is a fantastic post.');
post = bsky.pd_AddHashtag(post, 'cheese');
const res = bsky.post(post);
if (!res) console.log('Something failed while posting.');

More?

About

Basic Bluesky / atproto library for apps script; post from your Doc or Spreadsheet!

Topics

Resources

License

Stars

Watchers

Forks