]> wagner.pp.ru Git - oss/ljdump.git/commitdiff
get userpic data
authorgreg <greg@7994a137-d0a5-da11-ade6-0050bffea3d9>
Fri, 8 Sep 2006 08:46:56 +0000 (08:46 +0000)
committergreg <greg@7994a137-d0a5-da11-ade6-0050bffea3d9>
Fri, 8 Sep 2006 08:46:56 +0000 (08:46 +0000)
git-svn-id: file:///home/svn/ljdump/trunk@17 7994a137-d0a5-da11-ade6-0050bffea3d9

ljdump.py

index 066f9765a73504d7991e79fd0518eb24b838ee52..2df93f3b6424cec22ae387f7a7b7e054cb3f8a53 100755 (executable)
--- a/ljdump.py
+++ b/ljdump.py
@@ -156,6 +156,15 @@ except:
     pass
 origlastsync = lastsync
 
+r = server.LJ.XMLRPC.login(dochallenge({
+    'username': Username,
+    'ver': 1,
+    'getpickws': 1,
+    'getpickwurls': 1,
+}, Password))
+userpics = dict(zip(r['pickws'], r['pickwurls']))
+userpics['*'] = r['defaultpicurl']
+
 while True:
     r = server.LJ.XMLRPC.syncitems(dochallenge({
         'username': Username,
@@ -247,6 +256,14 @@ f = open("%s/user.map" % Username, "w")
 pickle.dump(usermap, f)
 f.close()
 
+f = open("%s/userpics.xml" % Username, "w")
+print >>f, """<?xml version="1.0"?>"""
+print >>f, "<userpics>"
+for p in userpics:
+    print >>f, """<userpic keyword="%s" url="%s" />""" % (p, userpics[p])
+print >>f, "</userpics>"
+f.close()
+
 newmaxid = maxid
 maxid = lastmaxid
 while True: