https://github.com/kgbier/feed-spidey-bot
RSS -> Discord Webhook worker bot
https://github.com/kgbier/feed-spidey-bot
aws-lambda discord-bot discord-webhook-bot rss webhook
Last synced: 12 months ago
JSON representation
RSS -> Discord Webhook worker bot
- Host: GitHub
- URL: https://github.com/kgbier/feed-spidey-bot
- Owner: kgbier
- License: mit
- Created: 2017-12-01T02:05:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T05:03:08.000Z (over 8 years ago)
- Last Synced: 2025-01-11T14:47:01.835Z (over 1 year ago)
- Topics: aws-lambda, discord-bot, discord-webhook-bot, rss, webhook
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spidey Bot feed reader
##### Konrad Biernacki (kgbier@gmail.com)
A Discord webhook bot that posts updates from rss/atom feeds, designed to be compiled and deployed into AWS Lambda.
- Dependency on AWS DynamoDB for per-feed record keeping
## Usage
1. Configure `./src/config/config.js` with AWS DynamoDB Table and Region
2. Configure `./src/config/updateChannels.js`, `./src/config/webhookEndpoints.js`, `./src/config/personalities.js` with valid webhook and feed data (as covered in [Overview](#overview))
3. `$ yarn build` - Compiles with webpack into `./dist/bundle.js`
4. `$ yarn deploy` - Uploads to a specified lambda function using the `aws-cli` (uses `./deploy.sh`)
## Run
`$ node run.js` to run the es6 program
or
`$ node run.bundle.js` to run the minified/bundled program
- config/webhookEndpoints.js
Describes a named collection of webhook endpoints.
```javascript
{
'spidey#totesnotrobots': {
path: '/api/webhooks/ID/TOKEN',
},
...
};
```
- config/personalities.js
A named collection of webhook Personalities. Comprises a Name, Colour, Avatar image, Thumbnail image, and a Subscriber webhook endpoint.
NB: Colour is expressed in Integer format
```javascript
{
'personalityOne': {
name: 'Personality Name',
colour: 16765995,
avatar: '.jpg',
thumbnail: '.jpg',
subscriber: 'spidey#totesnotrobots',
},
...
}
```
- config/updateChannels.js
Contains a list of Channels.
A Channel comprises a feed URL, a transform to compose the Discord Embed object from an Article, and a Personality to post articles to.
Transform object is required to compliment discord Embed object as seen [here](https://discordapp.com/developers/docs/resources/channel#embed-object).
```javascript
[
{
name: 'Channel',
description: 'Channel Description',
personality: 'personalityOne',
feedUrl: 'https://www.feeds.com/feed/',
transformer: (article, personality) => {
return {
title: article.title,
description: article.link,
timestamp: article.date,
color: personality.colour,
footer: {
text: VERSION_TEXT,
},
};
},
},
...
]
```