Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elizabethsiegle/offby1-bluesky-bot
Automate posts to BlueSky with Cloudflare Workers, Cron Triggers, and the Blue Sky API
https://github.com/elizabethsiegle/offby1-bluesky-bot
bluesky bluesky-api bluesky-bot cloudflare cloudflare-workers cron-jobs cron-triggers cronjob workers
Last synced: 21 days ago
JSON representation
Automate posts to BlueSky with Cloudflare Workers, Cron Triggers, and the Blue Sky API
- Host: GitHub
- URL: https://github.com/elizabethsiegle/offby1-bluesky-bot
- Owner: elizabethsiegle
- Created: 2024-11-14T00:27:24.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-12-13T19:11:36.000Z (about 2 months ago)
- Last Synced: 2024-12-13T20:20:23.486Z (about 2 months ago)
- Topics: bluesky, bluesky-api, bluesky-bot, cloudflare, cloudflare-workers, cron-jobs, cron-triggers, cronjob, workers
- Language: TypeScript
- Homepage: https://bsky.app/profile/offby1bot.bsky.social
- Size: 130 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Automate Posts to BlueSkyπ¦ with BlueSky API, Cloudflare Workers, Cron Triggers
[](https://youtu.be/489fB42i_zA "Automate Bluesky Posts using Cloudflare Workers, Cron Triggers, and the Bluesky API!")
This [Cloudflare Workers](https://workers.cloudflare.com/) app π©π»βπ» makes use of [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) to automate posting once a day to [Blue Sky](https://bsky.app/).
Checkβ it out on [Blue Sky here](https://bsky.app/profile/offby1bot.bsky.social)!π
## Setup
You need a Cloudflare account. Copy [.dev.vars.example](./.dev.vars.example) to `.dev.vars` and add your `BLUESKY_USERNAME` and `BLUESKY_PASSWORD`.```bash
npm install
npx wrangler login # if it's your first time here
```
If you want to start from scratch, run```
npm create cloudflare@latest
```
and pick `Hello World Example` and `TypeScript`.In [wrangler.toml](./wrangler.toml), you can set the time to post in the `crons` array beneath the `triggers` configuration. Reminder--cron tabs are written in UTC. I used the [Cloudflare Workers AI LLM Playground](https://playground.ai.cloudflare.com/) to generate my cron tabs using this system message from my wonderful teammate [Craig Dennis](https://twitter.com/craigsdennis):
```
You help write cron tabs.The user will give you a description of time they are looking for and your job is to generate a cron tab string.
The user will specify timezones, you know the server runs in UTC.
Return the cron tab and the explanation.
```## Develop locally
```bash
npm run dev
```## Deploy
```bash
npm run deploy
```