diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-01-08 17:42:35 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-01-08 17:42:35 +0100 |
commit | 862ecd1e98a825a39720f9a04f1ce1fe96d8fab3 (patch) | |
tree | e49e2abfbdba9422f543d7da8fd082789227e006 /xml2static_rst.py | |
parent | da2e12c20265160a3a684ae92f2f0817f73e3a34 (diff) | |
download | disqus_xml2static_rst-862ecd1e98a825a39720f9a04f1ce1fe96d8fab3.tar.gz |
Skip over deleted comments.
Fixes: https://todo.sr.ht/~mcepl/devel/24
Diffstat (limited to 'xml2static_rst.py')
-rw-r--r-- | xml2static_rst.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/xml2static_rst.py b/xml2static_rst.py index f5c0d68..5824efc 100644 --- a/xml2static_rst.py +++ b/xml2static_rst.py @@ -23,7 +23,9 @@ for thread in root.findall("dflt:thread", ns): out = {} for com_post in root.findall("dflt:post", ns): - if com_post.find('dflt:isSpam', ns).text == 'false': + is_spam = com_post.find('dflt:isSpam', ns).text == 'true' + is_del = com_post.find('dflt:isDeleted', ns).text == 'true' + if not (is_spam or is_del): thread = com_post.find('dflt:thread', ns) thread_id = thread.attrib[f"{{{ns['xsi']}}}id"] blurb = threads[thread_id]['blurb'] |