⬆️ ⬇️

Import entries from RSS to LiveJournal

Upd. The new version of the online service is available at http://ljimport.idzaaus.org . I will write an article about her later.



I wrote for myself a script for importing records into LiveJournal. Now another 50 users use this online service. Decided to write and here, to feel even more useful to society. As I strongly doubt that my site will withstand even a miserable similarity of habraeffekt, I decided to remake the script for use by one person and put the source code.



Actually, I was very surprised to learn that there is no such simple option in LiveJournal (or rather, it is only for paid accounts). Posting is done through the Blogger API, for it I took a ready implementation. Parser understands Windows-1251 and UTF-8 encodings. My script has been sharpened for import from the diary.ru online diaries website, for users of which some nice little things were taken into account.

')

To use the program, a PHP console client must be installed. The launch is performed by the command:

php ljimport.php [options]

Import start is carried out without arguments. Before this, enter the settings in the config.php file. If you do not want all the posts from the feed to be immediately added to the blog, immediately after adding the feed to the list, run the program with the -F key. Then the script will remember the current time and in the future it will only import records whose date is later than this moment. For security reasons, you can not write the password to the config, but enter it manually each time. For automatic import you can use cron.



You can download it on GoogleCode . Or via SVN:

svn checkout http://ljimport.googlecode.com/svn/trunk/ ljimport

Source: https://habr.com/ru/post/82005/



All Articles