main
Bob Mottram 2020-10-07 22:26:03 +01:00
parent e090a3c047
commit c440e31bc9
2 changed files with 33 additions and 10 deletions

View File

@ -10,7 +10,7 @@ import os
import time import time
from collections import OrderedDict from collections import OrderedDict
from newswire import getDictFromNewswire from newswire import getDictFromNewswire
from posts import createPublicPost from posts import createNewsPost
from utils import saveJson from utils import saveJson
from utils import getStatusNumber from utils import getStatusNumber
@ -94,15 +94,11 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
followersOnly = False followersOnly = False
useBlurhash = False useBlurhash = False
commentsEnabled = False blog = createNewsPost(baseDir,
blog = createPublicPost(baseDir, 'news', domain, port, httpPrefix,
'news', domain, port, httpPrefix, rssDescription, followersOnly, False,
rssDescription, followersOnly, False, None, None, None, useBlurhash,
False, commentsEnabled, rssTitle)
None, None, None, useBlurhash,
None, None, rssTitle,
False,
None, None, None)
if not blog: if not blog:
continue continue

View File

@ -1193,6 +1193,33 @@ def createBlogPost(baseDir: str,
return blog return blog
def createNewsPost(baseDir: str,
nickname: str, domain: str, port: int, httpPrefix: str,
content: str, followersOnly: bool, saveToFile: bool,
attachImageFilename: str, mediaType: str,
imageDescription: str, useBlurhash: bool,
subject: str) -> {}:
clientToServer = False
inReplyTo = None
inReplyToAtomUri = None
schedulePost = False,
eventDate = None
eventTime = None
location = None
blog = \
createPublicPost(baseDir,
nickname, domain, port, httpPrefix,
content, followersOnly, saveToFile,
clientToServer,
attachImageFilename, mediaType,
imageDescription, useBlurhash,
inReplyTo, inReplyToAtomUri, subject,
schedulePost,
eventDate, eventTime, location)
blog['object']['type'] = 'Article'
return blog
def createQuestionPost(baseDir: str, def createQuestionPost(baseDir: str,
nickname: str, domain: str, port: int, httpPrefix: str, nickname: str, domain: str, port: int, httpPrefix: str,
content: str, qOptions: [], content: str, qOptions: [],