Coder Social home page Coder Social logo

asfalothde / livejournal-export Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arty-name/livejournal-export

0.0 1.0 0.0 11 KB

Export your LiveJournal (posts + comments) to XML, JSON and optionally convert them to HTML and Markdown

Python 100.00%

livejournal-export's Introduction

Export your LiveJournal blog data

Livejournal provides a method to export your posts as XML. However this has to be done manually for every month of your blog. Also comments are exported separately. I wrote this tool to make exporting more convenient.

You will need Python 3 to use it.

export.py

This script will do the exporting. Run it after you have provided cookies and years as described below. You will end up with full blog contents in several formats. posts-html folder will contain basic HTML of posts and comments. posts-markdown will contain posts in Markdown format with HTML comments and metadata necessary to generate a static blog with Pelican. posts-json will contain posts with nested comments in JSON format should you want to process them further.

auth.py

First of all you will have to log into Livejournal and copy values of cookies ljloggedin and ljmastersession to the file auth.py.

download_posts.py

Edit this file to specify the range of years you want to export. This script will download your posts in XML into posts-xml folder. Also it will create posts-json/all.json file with all the same data in JSON format for convenient processing.

download_comments.py

This script will download comments from your blog as comments-xml/*.xml files. Also it will create comments-json/all.json with all the comments data in JSON format for convenient processing.

Requirements

  • html2text
  • markdown
  • beautifulsoup4
  • requests

Processing exported data separately

In the last lines of export.py there's a condition if True:. Change True to False to skip the downloading step and go directly to the processing of already downloaded data.

livejournal-export's People

Contributors

arty-name avatar josiahcarlson avatar skorasaurus avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.