This program posts links to news items on /r/technology on Reddit. The links are gathered from TechHeat. The project is licensed under Mozilla Public License 2.0.
Author: Daniel 'MaTachi' Jonsson, http://danielj.se
-
Install pip
sudo apt-get install python3-pip
-
Install PRAW
sudo pip-3.2 install praw
-
Install BeatuifulSoup
sudo pip-3.2 install beautifulsoup4
-
Install SQLite3
sudo apt-get install sqlite3
-
Install YAML
sudo apt-get install python3-yaml
-
Configure with your Reddit username and password:
-
Make a copy of bot-sample.ini named bot.ini:
cd configs ; cp bot-sample.ini bot.ini
-
Add your Reddit username and password to bot.ini:
vim bot.ini
-
-
Add permission to launch the program
chmod u+x bot.py
. -
Launch with
./bot.py
orpython3 bot.py
.
Automatic posting can be achieved by schedule launching bot.py with cron. Add a
cronjob with crontab -e
. List cronjobs with crontab -l
.
Cronjob to launch the script once every hour:
0 * * * * cd /home/pi/cloaked-chatter && ./bot.py
Or to launch it once every two hours:
0 1-23/2 * * * cd /home/pi/cloaked-chatter && ./bot.py
As the Linux username pi
suggests, in this case it's running on a Raspberry
Pi with Raspbian "wheezy". A Raspberry Pi is perfect for this type of project
considering its low energy consumption and that very little computing power is
needed.
- --level=[1,2,3,4,5]: Specify the freshness level, see bot.ini. This overrides the setting in bot.ini. Useful when scheduling multiple instances of the program and you want them to run with different levels.