Script to create pdf from stackoverflow posts based on their codes. It works by calling the API of http://stackprinter.com which renders a print-friendly form of the post. This is useful if you like to read the posts offline or you want to archive them.
Currently it does not support the other stack excange pages.
- urllib
- bs4
- weasyprint
- re
- Get the codes of the posts from their url. For instance, in the following url, https://stackoverflow.com/questions/31681373/making-svm-run-faster-in-python, the code you need is the number after '/questions/': '31681373'.
- Insert the codes into the
codes
list within the script. - Run the script
- From terminal:
python path-to-so2pdf/so2pdf.py
- From python:
run path-to-so2pdf/so2pdf.py
- From terminal:
- It will generate the pdfs into the folder from which you run it.