Commits

David Chambers committed 1dd1bcd

Updated WordPress conversion script – its output now includes time zone and author metadata.

  • Participants
  • Parent commits bd9df02

Comments (0)

Files changed (1)

 for page in server.wp.getPages(blog_id, username, password):
     html2text.BODY_WIDTH = BODY_WIDTH
     with open(os.path.join(DOCUMENTS_PATH, '%s.text' % page['wp_slug']), 'w') as f:
-        f.write(u'%s\n%s\n\n%s\n' % (page['title'], '=' * len(page['title']),
+        f.write(u'author: %s\n\n\n%s\n%s\n\n%s\n' % (
+                page['wp_author_display_name'],
+                page['title'], '=' * len(page['title']),
                 html2text.html2text(page['description']).strip()))
 
 for post in server.metaWeblog.getRecentPosts(blog_id, username, password, 0):
     dt = dt.replace(tzinfo=pytz.utc).astimezone(pytz.timezone(TIME_ZONE))
     lines.append(u'date: %s' % dt.strftime(MARKDOWN_DATE_FORMAT).lstrip('0'))
     lines.append(u'time: %s' % dt.strftime(MARKDOWN_TIME_FORMAT).lstrip('0').lower())
+    lines.append(u'zone: %s' % TIME_ZONE)
+    lines.append(u'author: %s' % post['wp_author_display_name'])
 
     if post['mt_keywords']:
         lines.append(u'tags: %s' % utils.unescape(post['mt_keywords']))