A simple python script to backup your roller blog.

I tried to find some backup tools for jroller, some only backs up the recent 30 entries in RSS feed, some does not handul unicode characters. By referring the python/xmlrpclib and MetaWeblog API documents, I wrote a simple backup tool, you could download it here. (But I did not find a good way to get tags for entries.) You may need to modify the global variables, like blogid/user/passwd.

#!/usr/bin/python
import xmlrpclib
blogid = 'yongsun'
user = 'yong.sun@sun.com'
passwd = '**********'
host = 'http://blogs.sun.com'
server = xmlrpclib.ServerProxy(host+'/roller-services/xmlrpc', use_datetime=True)
num = 1000
... ...
... ...

Please note that the passwd is the "Weblog Client API Password", it's probably your original login password, anyway, you could set it in your profile page.

4 thoughts on “A simple python script to backup your roller blog.

  1. python的版本呢?我试过但是出了错误。好像碰到https://63.246.22.60/browse/JRA-10516
    Traceback (most recent call last):
    File "/c/d/bin/roller_backup.py", line 56, in <module>
    posts = server.metaWeblog.getRecentPosts (blogid, user, passwd, num)
    File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
    File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
    File "/usr/lib/python2.5/xmlrpclib.py", line 1201, in request
    return self._parse_response(h.getfile(), sock)
    File "/usr/lib/python2.5/xmlrpclib.py", line 1335, in _parse_response
    p.feed(response)
    File "/usr/lib/python2.5/xmlrpclib.py", line 547, in feed
    self._parser.Parse(data, 0)
    xml.parsers.expat.ExpatError: reference to invalid character number: line 351, column 1

  2. Thanks. But, I want to back up whatever the illegel character I have on my blog. I hoped that was a known python or xmlrpclib problem. Looks like a good opportunity to debug and learn python for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha