Export favorites Habra in FB2 - high-speed PHP-version
At one time I had already seen such a converter here on Habré, written in python, but he devoured many, many, many resources on my typewriter and never could my favorites (and that’s 400+ posts) save to the end, dropping something on incorrect file, then the "curve" article. It was necessary to rewrite, results of works under a cat.
Python's save script in fb2 ate about 3 GB of RAM for me (and it was exactly 3 on the old laptop), and I never successfully completed the process successfully.
Comments on posts are saved? I added the corresponding function to the parser library, but did not save the file. If you have ideas on how to display comments with limited fb2 markup nicely, share your idea and will gladly complete the next patch.
Validation, file performance, known problems? In CoolReader under android opens 100%, windows-version of FBReader may fall on some articles. Not everything is correctly displayed - the table tags are deleted, the code does not turn into the corresponding tag (will be in the next patch). All uncorrected articles or pictures are silently discarded, no error logging.
How to start? Download, unpack to any virtual host, edit config.php for yourself and open in the browser. All the necessary libraries or bundled, or dokachivayutsya submodules.
Settings? In the config.php file , everything is signed by the Russian utf. You can, for example, disable saving pictures or change folders for saving data.
all actions are separated into separate files (download the list, download the article, save the picture)
in one step, one atomic action is performed (downloading one article, downloading one attached file, etc.). Thus, each script eats little memory, and works relatively quickly.
I found a bug / bug / curve code / I have an idea! Share here, in a personal, on github'e - in my free time I can do it.
Sample file (second version) . ~ 150 articles, size 22mb., 14 MB in compressed form. Pictures in the set, comments - no.
Update .Example fb2 file.400+ articles, total size ~ 53mb., Pictures are compressed to 400 pixels, archive size is 33.8 mb.Above is the latest version of the file. Update 2 . Short tags must be enabled for the script to work on the server. Not relevant for the new version of the script. Update 3 . Screenshot of the script during execution: Update 4 (02.27.2013) . Updated the script. Now tags are not thrown out. ( , ). ( config.php ). . Update 5 (27.02.2013) . . , - , . Update 6 (28.02.2013) . . ( XML). , FBreader , , - . . Update 7 (28.02.2013) . . - , .