mirror of https://gitlab.com/bashrc2/epicyon
Add hashtags for incoming news posts
parent
8f41ce4de1
commit
18f8643725
|
@ -378,11 +378,33 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
httpPrefix + '://' + domain + '/@news/' + statusNumber
|
httpPrefix + '://' + domain + '/@news/' + statusNumber
|
||||||
blog['object']['published'] = dateStr
|
blog['object']['published'] = dateStr
|
||||||
|
|
||||||
|
domainFull = domain
|
||||||
|
if port:
|
||||||
|
if port != 80 and port != 443:
|
||||||
|
domainFull = domain + ':' + str(port)
|
||||||
|
|
||||||
|
hashtags = item[6]
|
||||||
|
for tagName in hashtags:
|
||||||
|
htId = tagName.replace('#', '')
|
||||||
|
hashtagUrl = \
|
||||||
|
httpPrefix + "://" + domainFull + "/tags/" + htId
|
||||||
|
blog['object']['tag'][htId] = {
|
||||||
|
'href': hashtagUrl,
|
||||||
|
'name': tagName,
|
||||||
|
'type': 'Hashtag'
|
||||||
|
}
|
||||||
|
if tagName in blog['object']['content']:
|
||||||
|
hashtagHtml = \
|
||||||
|
"<a href=\"" + hashtagUrl + \
|
||||||
|
"\" class=\"mention hashtag\" " + \
|
||||||
|
"rel=\"tag\">#<span>" + \
|
||||||
|
htId + "</span></a>"
|
||||||
|
blog['object']['content'].replace(tagName, hashtagHtml)
|
||||||
|
|
||||||
postId = newPostId.replace('/', '#')
|
postId = newPostId.replace('/', '#')
|
||||||
|
|
||||||
moderated = item[5]
|
moderated = item[5]
|
||||||
|
|
||||||
hashtags = item[6]
|
|
||||||
savePost = newswireHashtagProcessing(session, baseDir, blog, hashtags,
|
savePost = newswireHashtagProcessing(session, baseDir, blog, hashtags,
|
||||||
httpPrefix, domain, port,
|
httpPrefix, domain, port,
|
||||||
personCache, cachedWebfingers,
|
personCache, cachedWebfingers,
|
||||||
|
|
Loading…
Reference in New Issue