def _years (self): """ Yield all years with posts """ cal = web.wget ("http://%s.livejournal.com/calendar" % self.blog) parser = LJCalendarYearsParser (cal) for y in parser.years: yield y
def _posts (self, year, mon): idx_data = web.wget ("http://%s.livejournal.com/%04d/%02d/" % (self.blog, year, mon)) parser = LJCalendarIndexParser (idx_data) for day, url in parser.posts: yield ("%4d-%02d-%02d" % (year, mon, day), url)