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.
评论:

cool :)

发表于 feng 在 2009年02月11日, 02:18 下午 CST #

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

发表于 Katsumi INOUE 在 2009年02月16日, 01:37 下午 CST #

Hi, Katsumi, it's already a python program. And looks like you may have illegal characters in your entry.

发表于 Yong Sun 在 2009年02月16日, 02:17 下午 CST #

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.

发表于 Katsumi INOUE 在 2009年02月19日, 10:25 上午 CST #

发表一条评论:
该日志评论功能被禁用了。

This blog copyright 2009 by yongsun