Test with quote

main
Bob Mottram 2020-10-11 11:57:18 +01:00
parent abcda1af1e
commit 78286119ea
1 changed files with 8 additions and 4 deletions

View File

@ -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
@ -109,14 +110,16 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
newswire[originalDateStr][3] = filename newswire[originalDateStr][3] = filename
continue continue
rssTitle = removeControlCharacters(item[0]) # rssTitle = removeControlCharacters(item[0])
rssTitle = item[0]
url = item[1] url = item[1]
if dangerousMarkup(url) or dangerousMarkup(rssTitle): if dangerousMarkup(url) or dangerousMarkup(rssTitle):
continue continue
rssDescription = '' rssDescription = ''
# get the rss description if it exists # get the rss description if it exists
rssDescription = removeControlCharacters(item[4]) # rssDescription = removeControlCharacters(item[4])
rssDescription = item[4]
if rssDescription.startswith('<![CDATA['): if rssDescription.startswith('<![CDATA['):
rssDescription = rssDescription.replace('<![CDATA[', '') rssDescription = rssDescription.replace('<![CDATA[', '')
rssDescription = rssDescription.replace(']]>', '') rssDescription = rssDescription.replace(']]>', '')
@ -144,9 +147,10 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
# published time), so we change that later # published time), so we change that later
blog = createNewsPost(baseDir, blog = createNewsPost(baseDir,
domain, port, httpPrefix, domain, port, httpPrefix,
rssDescription, followersOnly, False, urllib.parse.quote(rssDescription),
followersOnly, False,
None, None, None, useBlurhash, None, None, None, useBlurhash,
rssTitle) urllib.parse.quote(rssTitle))
if not blog: if not blog:
continue continue