main
Bob Mottram 2019-12-12 18:14:55 +00:00
parent 851ac0fc18
commit 6df175a641
2 changed files with 4 additions and 3 deletions

View File

@ -97,7 +97,8 @@ def validHashTag(hashtag: str) -> bool:
return True
return False
def addHashTags(wordStr: str,httpPrefix: str,domain: str,replaceHashTags: {},postHashtags: {}) -> bool:
def addHashTags(wordStr: str,httpPrefix: str,domain: str, \
replaceHashTags: {},postHashtags: {}) -> bool:
"""Detects hashtags and adds them to the replacements dict
Also updates the hashtags list to be added to the post
"""

View File

@ -84,8 +84,8 @@ def storeHashTags(baseDir: str,postJsonObject: {}) -> None:
continue
if not tag.get('name'):
continue
tagName=tag['name'].replace('#','')
tagsFilename=tagsDir+'/'+tag['name']+'.txt'
tagName=tag['name'].replace('#','').replace("'",'')
tagsFilename=tagsDir+'/'+tagName+'.txt'
postUrl=postJsonObject['id'].replace('/activity','').replace('/','#')
if not os.path.isfile(tagsFilename):
tagsFile=open(tagsFilename, "w+")