Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elizabethsiegle/inspirebot-workers-ai-bluesky
Blue Sky bot that posts every 30 minutes powered by Cloudflare Workers AI + Cron Triggers
https://github.com/elizabethsiegle/inspirebot-workers-ai-bluesky
bluesky bluesky-api bluesky-bot cloudflare cloudflare-cron-triggers cloudflare-workers cloudflare-workers-ai cron-triggers cronjob workers
Last synced: about 2 months ago
JSON representation
Blue Sky bot that posts every 30 minutes powered by Cloudflare Workers AI + Cron Triggers
- Host: GitHub
- URL: https://github.com/elizabethsiegle/inspirebot-workers-ai-bluesky
- Owner: elizabethsiegle
- Created: 2024-11-15T00:14:54.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-15T00:17:47.000Z (about 2 months ago)
- Last Synced: 2024-11-15T01:19:53.451Z (about 2 months ago)
- Topics: bluesky, bluesky-api, bluesky-bot, cloudflare, cloudflare-cron-triggers, cloudflare-workers, cloudflare-workers-ai, cron-triggers, cronjob, workers
- Language: TypeScript
- Homepage: https://bsky.app/profile/inspirebot.bsky.social
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Automate Posts to BlueSky with BlueSky API, Cloudflare Workers, Cron Triggers
This is a [Cloudflare Workers](https://workers.cloudflare.com/) application that makes use of [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) to automate posting to [Blue Sky](https://bsky.app/).Every 30 minutes, the application generates an inspiring saying using [llama-3.2-3b-instruct](https://developers.cloudflare.com/workers-ai/models/llama-3.2-3b-instruct/) hosted on [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) and posts it to Blue Sky.
Check it out on [Blue Sky here](https://bsky.app/profile/inspirebot.bsky.social)!
## Setup
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
```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
```