Advice scraper from fucking-great-advice.ru. This is a legacy project that was written several years ago, the site may have changed since then, so it is possible that you'll have to update the scraper accordingly.
However, the results stored in out/
are ready for use, and they reflect the state of site at the time
the scraper was written.
- Create and activate virtualenv
- Install dependencies from
requirements.txt
- Run
scrapy crawl advice -o advice-fortune.csv -s JOBDIR=crawls/advice-1
apt install fortune-mod
(this is needed to usestrfile
below; if you already have the fortune file, you only needfortune
itself)- Make sure your CSV file with advices is ready
- Convert it to the right text format by running
python csv-to-fortune.py
(it takesadvice-fortune.csv
and saves it toadvice-fortune.txt
- Run
strfile -c % advice-fortune.txt advice-fortune.dat
to convert it to the fortune format sudo cp advice-fortune.dat /usr/share/games/fortunes && sudo cp advice-fortune.txt /usr/share/games/fortunes/advice-fortune
(you might have to recreate the directories first)- For an extra-dramatic effect:
apt install cowsay
- Add
fortune | cowsay
to the end of your~/.bashrc