Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/advaith1/ed-poster
Crosspost Ed Discussion posts to Discord
https://github.com/advaith1/ed-poster
Last synced: 11 days ago
JSON representation
Crosspost Ed Discussion posts to Discord
- Host: GitHub
- URL: https://github.com/advaith1/ed-poster
- Owner: advaith1
- License: mit
- Created: 2024-01-09T21:10:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-30T07:30:44.000Z (8 months ago)
- Last Synced: 2024-11-08T07:56:43.545Z (2 months ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ed-poster
ed-poster crossposts all posts and announcements from Ed Discussion into Discord, with a button to view the original post in Ed Discussion. Announcements are posted to an announcements channel, and other posts are posted to a feed channel.
## Prerequisites
ed-poster runs on Cloudflare Workers for free.
You will need:
* A [Cloudflare account](https://dash.cloudflare.com/sign-up)
* [Node.js](https://nodejs.org/en) installed locally
* A Discord server, where you have Manage Webhook permissions## Setup
First, clone this repository and run `pnpm i`. (If pnpm isn't installed, run `corepack enable` first.) Copy wrangler.example.toml to wrangler.toml and courses.example.json to courses.json.
Create an [Ed API token](https://edstem.org/us/settings/api-tokens). Run `pnpm set-token` and type in the API token when prompted. You may be prompted to log in to your Cloudflare account first.
Run `pnpm create-kv`, then copy the provided binding ID into wrangler.toml.
In courses.json, set the `courseID` to a unique string for the course, and set `edID` to the numeric course ID in the Ed URL.
Use [Webhook Creator](https://webhook-creator.advaith.workers.dev) to create a webhook in the announcements channel and get the URL. (Don't create the webhook in Discord settings, use this tool instead.) Copy the URL it gives you and set it as `announcementWebhook` in courses.json.
Do the same for the feed channel, setting the second webhook's `url` as `feedWebhook`.
When you're done, run `pnpm run deploy`. ed-poster will now check every minute for new Ed posts and send them to the appropriate Discord channel.