Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anirbanmu/substitute-bot-go
Version of substitute-bot written in go (original is in Ruby)
https://github.com/anirbanmu/substitute-bot-go
bot go golang substitute-bot
Last synced: 3 months ago
JSON representation
Version of substitute-bot written in go (original is in Ruby)
- Host: GitHub
- URL: https://github.com/anirbanmu/substitute-bot-go
- Owner: anirbanmu
- Created: 2019-10-05T16:47:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T10:15:13.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T19:04:59.500Z (7 months ago)
- Topics: bot, go, golang, substitute-bot
- Language: Go
- Size: 89.8 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# substitute-bot-go
[![checks](https://github.com/anirbanmu/substitute-bot-go/workflows/checks/badge.svg)](https://github.com/anirbanmu/substitute-bot-go/actions?query=workflow%3Achecks)
A [Reddit](https://www.reddit.com/) bot that provides the ability to search and replace parent comments. Supports Go regular expression syntax. Aim is not to support everything, just very simple replacement. This is a port of the original Ruby [substitute-bot](https://github.com/anirbanmu/substitute-bot) into Go.
## Compatibility
This project uses Go modules so please use a version of Go (>= 1.11) that supports them. This has been developed and tested with Go 1.13.1.
## Setup
- Clone this repo
- The following environment variables are required to run:
- `SUBSTITUTE_BOT_CLIENT_ID=`
- `SUBSTITUTE_BOT_CLIENT_SECRET=`
- `SUBSTITUTE_BOT_USERNAME=`
- `SUBSTITUTE_BOT_PASSWORD=`
- `SUBSTITUTE_BOT_USER_AGENT=`
- The following environment variables are optional:
- `SUBSTITUTE_BOT_PORT=` (only used by web frontend; defaults to 3000)
- To run the bot: `go run cmd/bot/main.go`
- To run the web frontend that shows recent replies: `go run cmd/bot/main.go cmd/bot/index.html.go cmd/bot/style.css.go`## Testing
- Some of the tests utilize [Gingko/Gomega](https://onsi.github.io/ginkgo/)
- `go test --cover --short ./...`## Live
You can check out the live running web frontend @ https://substitute-bot.electrostat.xyz