mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-04 19:52:33 +00:00
Getting tags from posts
This commit is contained in:
1 parent
10d4010cd8
commit
ab48e6d456
2 files changed
+4
-3
No files matched your search
+2
-1
@@ -464,11 +464,12 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
||||
htId = tagName.replace('#', '')
|
||||
hashtagUrl = \
|
||||
httpPrefix + "://" + domainFull + "/tags/" + htId
|
||||
blog['object']['tag'][htId] = {
|
||||
newTag = {
|
||||
'href': hashtagUrl,
|
||||
'name': tagName,
|
||||
'type': 'Hashtag'
|
||||
}
|
||||
blog['object']['tag'].append(newTag)
|
||||
if tagName in blog['object']['content']:
|
||||
hashtagHtml = \
|
||||
"<a href=\"" + hashtagUrl + \
|
||||
|
||||
+2
-2
@@ -384,10 +384,10 @@ def getHashtagsFromPost(postJsonObject: {}) -> []:
|
||||
return []
|
||||
if not postJsonObject['object'].get('tag'):
|
||||
return []
|
||||
if not isinstance(postJsonObject['object']['tag'], dict):
|
||||
if not isinstance(postJsonObject['object']['tag'], list):
|
||||
return []
|
||||
tags = []
|
||||
for tg in postJsonObject['object']['tag'].items():
|
||||
for tg in postJsonObject['object']['tag']:
|
||||
if not isinstance(tg, dict):
|
||||
continue
|
||||
if not tg.get('name'):
|
||||
|
||||
Reference in new issue
Block a user