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 True
return False 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 """Detects hashtags and adds them to the replacements dict
Also updates the hashtags list to be added to the post Also updates the hashtags list to be added to the post
""" """

View File

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