A bot for claim daily free learning ebooks from packtpub. It also notify you over Pushbullet. It's designed as cron job task on a Raspberry Pi.
- node.js, version 6.0.0+ (only tested on v6)
git clone https://github.com/mtuanp/packtpubbot.git
The bot uses a json configuration file for providing login credentials. Add file names config.json in your working directory where you cloned. Example of config.json:
{
"packtpub": {
"email": "put your email here",
"password": "put your password here"
},
"pushbullet": {
"apiKey": "put your pushbullet api key here"
}
}
After set up your config.json, you start the bot with following statements:
npm install # only on first run
npm start
Find the absolute location of npm and copy it:
which node
Open cron job table with:
crontab -e
Add following statements for every day cron job at 9 am:
0 9 * * * <PATH_TO_NODE>/node <PATH_TO_REPO>/index.js >> /var/log/packtpub.log 2>&1