This repository includes the code for the brunei_news_bot
reddit account which monitors a list of subreddit for new post with links to news articles and automatically scrape the website for the content and post it as a reply.
- Supported Websites:
- Posts a comment reply with the news title, date and content.
- .NET 5.0 SDK
- Windows/Linux/Mac
- Create
appsettings.json
in project folder with the following structure.
{
"Reddit": {
"Secret": "",
"AppId": "",
"RefreshToken": ""
},
"Imgur": {
"ClientId": ""
},
"Proxy": {
"Host": "",
"Port": 80,
"Username": "",
"Password": ""
},
"Subreddits": "testingground4bots"
}
- Run
dotnet run
.
- Open a terminal in the
RedditBruneiNewsBot
directory in this repository. - Run
dotnet build -c Release -o app
. - This will create a build in the
app
folder. - Build configuration can be customised. E.g. To create a single
.exe
file that runs on Windows, etc. Please refer to the Microsoft Docs for further information.
- Copy the
app
folder from the previous section to somewhere safe on the server. - Change working directory into the
app
folder. - Update
appsettings.json
or set it through environment variables. E.g.
Reddit__Secret=123
Reddit__AppId=123
Reddit__RefreshToken=123
Imgur__ClientId=123
Subreddits=123,456
- Run
dotnet RedditBruneiNewsBot.dll
.