This commit is contained in:
Jesús 2020-04-21 16:18:44 -05:00
parent 6ad5d4e6cb
commit 63808cbbb2
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -7,6 +7,7 @@ from lxml import etree
COMMENT_DIR = 'comments'
def wp2comments(xml):
# xmlfile = open(xml, encoding='utf-8', mode='r').read()
@ -24,7 +25,8 @@ def wp2comments(xml):
for item in items:
title = item.find('title')
if title is None: continue
if title is None:
continue
# Only fetch comments from published posts.
status = item.find('wp:status', namespaces=root.nsmap)
@ -69,6 +71,7 @@ def wp2comments(xml):
f.write(u'Date: %s\n' % (date, ))
f.write(u'Author_Email: %s\n' % (email, ))
f.write(u'Author_IP: %s\n' % (ip, ))
f.write(u'Web: %s\n' % (url, ))
f.write(u'\n%s\n' % (content, ))
f.close()