Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

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