Simple Script to Fetch and Filter Hacker News based on your Interests, designed to be run as a cron job
Fetching latest commit…
Cannot retrieve the latest commit at this time
This bash script fetches the front page of Hacker News and filters the submissions by your interests and outputs those to NEWS.html on your desktop. Works on BSD (includes Mac OS) and Linux-based systems. For Hacker News addicts like me, it means I don't worry that I'll miss a submission that's only briefly on the front page if I don't peruse Hacker News compulsively. It just show's up automatically on my Desktop. I can read it whenever I have time, and submissions stay there until I delete them. !!! Make sure you put interests.txt on your Desktop. If you want to keep it elsewhere, edit the first non-commented line in filterHN.command Edit your interests in interests.txt. It's designed to be run as a cronjob. This means it won't overwrite existing submissions stored in NEWS.html, nor will it add duplicates. Test it out: cd /PATH/TO/FILES/ cp interests.txt ~/Desktop/interests.txt ./filterHN.command You might need to make it executable, either right click it or chmod a+x filterHN.command To have this run automatically in the background, start a Cron job by editting your crontab with: crontab -e In Ubuntu, you'll get a choice of text editors, but in Mac OS you have to use vim. Vim instructions at the very bottom.*** To fetch hourly, substitute in the correct path and paste to your crontab: 0 * * * * /PATH/TO/filterHN.command To fetch every half hour: 0,30 * * * * /PATH/TO/filterHN.command Every five minutes... */5 * * * * /PATH/TO/COMMAND !!! Very important to make sure there is a new-line after the configuration line. This means just pressing enter before saving. Otherwise cron will not run on some systems. If you have issues or advice, please email me at your leisure patrick.cieplak at gmail.com. ***Vim Instructions for Mac OS users wanting to start cron job: Once you enter crontab -e you find yourself in vim. Press the letter i on your keyboard. Having done this, you can then paste in something by pressing CNTRL-SHIFT-V When it looks something like this press Esc key several times: 0 * * * * /PATH/TO/filterHN.command Make sure you press enter to create a new-line after the first line. To go back and make changes press the letter i on keyboard. After having pressed Esc key once or several times, very carefully type a colon character followed by the letter 'w' and the letter 'q'. It will look like :wq Then press enter and you're done.