digi-wolk / rss-feed-reader

Reads RSS feeds and then it can comment new items on Slack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Test status Code quality status goSec security status

License Last commit Contributors

About

Reads RSS feeds.

Example usage

Get one RSS feed:

go run cmd/rssread/rssread.go -rss-feed=https://aws.amazon.com/about-aws/whats-new/recent/feed/

Get multiple RSS feeds from a config file:

go run cmd/rssread/rssread.go -rss-conf=config/rss-feeds.txt

Specify how many hours back to look for new items (default is 24 hours)

go run cmd/rssread/rssread.go -rss-feed=https://aws.amazon.com/about-aws/whats-new/recent/feed/ -hours-back=1

Specify to return text or JSON:

go run cmd/rssread/rssread.go -rss-feed=xxxx -output=text
go run cmd/rssread/rssread.go -rss-feed=xxxx -output=json

Verbose logs (suitable for debugging):

go run cmd/rssread/rssread.go -rss-feed=xxxx -verbose

Filter based on one or more keywords:

# One keyword
go run cmd/rssread/rssread.go -rss-feed=xxxx -filter-words=glue
# Multiple keywords
go run cmd/rssread/rssread.go -rss-feed=xxxx -filter-words=glue,athena
# Case insensitive
go run cmd/rssread/rssread.go -rss-feed=xxxx -filter-words=glue,athena -case-insensitive

Exclude based on one or more keywords:

# One keyword
go run cmd/rssread/rssread.go -rss-feed=xxxx -exclude-words=glue
# Multiple keywords
go run cmd/rssread/rssread.go -rss-feed=xxxx -exclude-words=glue,athena
# Case insensitive
go run cmd/rssread/rssread.go -rss-feed=xxxx -exclude-words=glue,athena -case-insensitive

Combine filter and exclude keywords:

go run cmd/rssread/rssread.go -rss-feed=xxxx -filter-words=athena -exclude-words=glue

Comment on Slack:

# Slack Token should be set as environment variable
export SLACK_API_TOKEN=xxxx
# Slack channel is required if output is set to slack-comment
go run cmd/rssread/rssread.go -rss-feed=https://aws.amazon.com/about-aws/whats-new/recent/feed/ -output=slack-comment -slack-channel=xxx

Check the latest version

You can get the latest version number by:

git describe --abbrev=0 --tags --match "v*"

Release a new version

You can create a release by tagging the version as follows:

# Update the version before running the command
RELEASE_VERSION="v1.0.0"
git tag "${RELEASE_VERSION}" -m "Release version ${RELEASE_VERSION}"
git push origin "${RELEASE_VERSION}"

The GitHub Action release workflow triggers immediately after the tag is pushed upstream. It will build and publish the docker image into DockerHub.

Docker Hub

Docker image is available on Docker Hub.

You can pull the latest version by running the following command:

docker pull prazian/rss-feed-reader:latest

You can pull a specific version by running the following command:

docker pull prazian/rss-feed-reader:v1

If you have Docker locally installed, you can run the commands like this:

Read as text in CLI:

docker run --rm -it \
  prazian/rss-feed-reader:v1 \
  -rss-feed=https://aws.amazon.com/about-aws/whats-new/recent/feed/ \
  -output=text \
  -hours-back=24

Comment on an specific Slack channel:

export SLACK_API_TOKEN=xxx
docker run --rm -it -e GO111MODULE=on \
  prazian/rss-feed-reader:v1 \
  -rss-feed=https://aws.amazon.com/about-aws/whats-new/recent/feed/ \
  -output=slack-comment \
  -slack-channel=xxxx \
  -hours-back=1

Documentation

About

Reads RSS feeds and then it can comment new items on Slack

License:Apache License 2.0


Languages

Language:Go 85.7%Language:Dockerfile 9.2%Language:Makefile 4.1%Language:Shell 1.0%