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

https://github.com/healeycodes/reddit-bot-tutorial

Build a friendly bot to keep you company on Reddit! :robot:
https://github.com/healeycodes/reddit-bot-tutorial

Last synced: about 1 year ago
JSON representation

Build a friendly bot to keep you company on Reddit! :robot:

Awesome Lists containing this project

README

          

This repository contains the files that accompany [my tutorial](https://healeycodes.github.io/tutorial/python/beginners/webdev/2019/03/25/reddit-bot-tutorial.html) for writing a Reddit bot!


![](https://github.com/healeycodes/Reddit-Bot-Tutorial/blob/master/header.png)


These brief instructions should get you up and running. Refer to my tutorial for a complete walkthrough 😊

Remember to follow Reddit's [bottiquette](https://www.reddit.com/wiki/bottiquette) at all times!

### Setup

- `pip install praw`
- Create your Reddit script app, and get your client id and client secret:


![](https://github.com/healeycodes/Reddit-Bot-Tutorial/blob/master/setup.png)


- Set the following environment variables:

```
$env:CLIENTID='id-here'
$env:CLIENTSECRET='secret-here'
$env:CLIENTUSER='reddit-user-name'
$env:CLIENTPASS='reddit-password'
```

- Pass in comma delimited search phrases, or a single string:
- `python bot.py --search 'phrase one, two, and three' --reply 'found you!'`


### Contributing

You're very welcome to expand the bot or raise any issues.


License: MIT