GifvBot is a Reddit bot that automatically posts the .gifv link in response to submissions containing a link to animated images/videos on imgur. It is currently active and running under the username u/gifv-bot.
For general information not related to the code see the FAQ.
Since this is a C# console application, you'll need a current version of Visual Studio.
- Create a Reddit account.
- Authorize the account so it can access the Reddit OAuth API. You'll need to create a Reddit application and then perform the authorization flow manually. Make sure to use
duration=permanent
so you can get a refresh token. See Reddit's documentation for detailed instructions. - Set up environment variables.
GIFVBOT_REDDIT_USERNAME
: the username of the Reddit accountGIFVBOT_REDDIT_CLIENT_ID
: the ID of the Reddit applicationGIFVBOT_REDDIT_SECRET
: the secret of the Reddit applicationGIFVBOT_REDDIT_REFRESH_TOKEN
: the refresh token you acquired after performing the authorization flow withduration=permanent
- Start the application. It will keep running on its own.
Note: By default, comment posting is disabled to prevent duplicate comments since there is already an instance of this bot running. To enable comment posting regardless, set the GIFVBOT_IS_COMMENTING_ENABLED
environment variable to true
(you probably shouldn't do this!).