forked from indymedia/epicyon
Getting tags from posts
parent
10d4010cd8
commit
ab48e6d456
|
@ -464,11 +464,12 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||||
htId = tagName.replace('#', '')
|
htId = tagName.replace('#', '')
|
||||||
hashtagUrl = \
|
hashtagUrl = \
|
||||||
httpPrefix + "://" + domainFull + "/tags/" + htId
|
httpPrefix + "://" + domainFull + "/tags/" + htId
|
||||||
blog['object']['tag'][htId] = {
|
newTag = {
|
||||||
'href': hashtagUrl,
|
'href': hashtagUrl,
|
||||||
'name': tagName,
|
'name': tagName,
|
||||||
'type': 'Hashtag'
|
'type': 'Hashtag'
|
||||||
}
|
}
|
||||||
|
blog['object']['tag'].append(newTag)
|
||||||
if tagName in blog['object']['content']:
|
if tagName in blog['object']['content']:
|
||||||
hashtagHtml = \
|
hashtagHtml = \
|
||||||
"<a href=\"" + hashtagUrl + \
|
"<a href=\"" + hashtagUrl + \
|
||||||
|
|
|
@ -384,10 +384,10 @@ def getHashtagsFromPost(postJsonObject: {}) -> []:
|
||||||
return []
|
return []
|
||||||
if not postJsonObject['object'].get('tag'):
|
if not postJsonObject['object'].get('tag'):
|
||||||
return []
|
return []
|
||||||
if not isinstance(postJsonObject['object']['tag'], dict):
|
if not isinstance(postJsonObject['object']['tag'], list):
|
||||||
return []
|
return []
|
||||||
tags = []
|
tags = []
|
||||||
for tg in postJsonObject['object']['tag'].items():
|
for tg in postJsonObject['object']['tag']:
|
||||||
if not isinstance(tg, dict):
|
if not isinstance(tg, dict):
|
||||||
continue
|
continue
|
||||||
if not tg.get('name'):
|
if not tg.get('name'):
|
||||||
|
|
Loading…
Reference in New Issue