Parse text from rss before it is used to create ActivityPub posts

main
Bob Mottram 2020-10-10 09:38:39 +01:00
parent 00b9d1fac0
commit 2d004cf9f2
1 changed files with 3 additions and 4 deletions

View File

@ -9,6 +9,7 @@ __status__ = "Production"
import os
import time
import datetime
import urllib.parse
from collections import OrderedDict
from newswire import getDictFromNewswire
from posts import createNewsPost
@ -73,8 +74,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
dateStr = dateStr.replace(' ', 'T')
dateStr = dateStr.replace('+00:00', 'Z')
# pubDate = datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%SZ")
statusNumber, published = getStatusNumber(dateStr)
newPostId = \
httpPrefix + '://' + domain + \
@ -91,8 +90,8 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
newswire[originalDateStr][3] = filename
continue
rssTitle = item[0]
url = item[1]
rssTitle = urllib.parse.unquote_plus(item[0])
url = urllib.parse.unquote_plus(item[1])
rssDescription = ''
# get the rss description if it exists