Code Monkey home page Code Monkey logo

Comments (6)

daniilr avatar daniilr commented on July 30, 2024

I guess, no, as I didn't find it on: http://www.livejournal.com/doc/server/ljp.csp.xml-rpc.protocol.html

This is a official XML RPC protocol of LiveJournal. Obviously it will never have archive function (if you mean "dump to disk" function). LJServer is a wrapper for this interface. BTW take a look at backup script at backup.py. I guess it should be rewritten with better option for serialization.

  1. It's written in python2.

We don't support python 3 for now. But this a great suggestion.

from python-lj.

rominf avatar rominf commented on July 30, 2024

@daniilr
I can port it to python3. Do you mind?
I would drop python2 support, because it's legacy and it's python2-python3 code is unidiomatic.

from python-lj.

daniilr avatar daniilr commented on July 30, 2024

Would be great. I am working to write unittests now

from python-lj.

daniilr avatar daniilr commented on July 30, 2024

@rominf check out #3

from python-lj.

markfortma avatar markfortma commented on July 30, 2024

I don't know where else to post this - so I am putting it here:

def datetime_from_string(s):
    """This assumes input in the form '2007-11-19 12:24:01' because that's all I care about"""
    if(s):
        date_s = s.split(' ')
        print(date_s)
        year_s, month_s, day_s = date_s[0].split('-')
        hour_s, min_s, sec_s = date_s[1].split(':')
        return datetime.datetime(int(year_s), int(month_s), int(day_s), int(hour_s), int(min_s), int(sec_s))
    # Fallback: Y2K
    return datetime.datetime(2000,1,1,0,0,0,0)

I encountered NoneType often and this corrected it.

Also, keywords all and id are Python keywords, switch them to all_ and id_ or select a new variable name; they were found in many of the functions in backup.py

from python-lj.

daniilr avatar daniilr commented on July 30, 2024

@markfortma
Changed it to:

return datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S")

I think strptime is the best approach here. Who needs manual parsing? :)

from python-lj.

Related Issues (8)

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.