forked from indymedia/epicyon
Parse text from rss before it is used to create ActivityPub posts
parent
00b9d1fac0
commit
2d004cf9f2
|
@ -9,6 +9,7 @@ __status__ = "Production"
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
import urllib.parse
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from newswire import getDictFromNewswire
|
from newswire import getDictFromNewswire
|
||||||
from posts import createNewsPost
|
from posts import createNewsPost
|
||||||
|
@ -73,8 +74,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
dateStr = dateStr.replace(' ', 'T')
|
dateStr = dateStr.replace(' ', 'T')
|
||||||
dateStr = dateStr.replace('+00:00', 'Z')
|
dateStr = dateStr.replace('+00:00', 'Z')
|
||||||
|
|
||||||
# pubDate = datetime.strptime(dateStr, "%Y-%m-%dT%H:%M:%SZ")
|
|
||||||
|
|
||||||
statusNumber, published = getStatusNumber(dateStr)
|
statusNumber, published = getStatusNumber(dateStr)
|
||||||
newPostId = \
|
newPostId = \
|
||||||
httpPrefix + '://' + domain + \
|
httpPrefix + '://' + domain + \
|
||||||
|
@ -91,8 +90,8 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
newswire[originalDateStr][3] = filename
|
newswire[originalDateStr][3] = filename
|
||||||
continue
|
continue
|
||||||
|
|
||||||
rssTitle = item[0]
|
rssTitle = urllib.parse.unquote_plus(item[0])
|
||||||
url = item[1]
|
url = urllib.parse.unquote_plus(item[1])
|
||||||
rssDescription = ''
|
rssDescription = ''
|
||||||
|
|
||||||
# get the rss description if it exists
|
# get the rss description if it exists
|
||||||
|
|
Loading…
Reference in New Issue