import sys, urllib, re if len(sys.argv)==1: name = raw_input("enter username including users/ if applicable: ") else: name=sys.argv[1] r = urllib.urlopen("http://www.livejournal.com/"+name+"/calendar").read() def getyear(text): for month in reversed(re.findall('"http://www\.livejournal\.com/'+name+'/\d+/\d+/\"', text)): y, m = month[29+len(name):-2].split("/") text2 = urllib.urlopen(month[1:-1]).read() for subject in reversed(re.findall("'http://www\.livejournal\.com/"+name+"/\d+\.html'", text2)): print y+"/"+m+": "+ subject[29+len(name):-6] text3 = urllib.urlopen(subject[1:-1]).read() open("lj."+name.split("/")[-1]+"."+y+"-"+m+"."+subject[29+len(name):-1], "w").write(text3) for year in reversed(re.findall('"http://www\.livejournal\.com/'+name+'/\d+/"', r)): getyear(urllib.urlopen(year[1:-1]).read()) getyear(r) #Richard Nichols III (http://www.gate.net/~inhahe) 12/9/05