mirror of https://gitlab.com/bashrc2/epicyon
Apply instance level blocks to hashtag category feeds
parent
572112bd66
commit
1426fefe5d
|
@ -203,7 +203,7 @@ def parseFeedDate(pubDate: str) -> str:
|
||||||
return pubDateStr
|
return pubDateStr
|
||||||
|
|
||||||
|
|
||||||
def xml2StrToHashtagCategories(baseDir: str, xmlStr: str,
|
def xml2StrToHashtagCategories(baseDir: str, domain: str, xmlStr: str,
|
||||||
maxCategoriesFeedItemSizeKb: int) -> None:
|
maxCategoriesFeedItemSizeKb: int) -> None:
|
||||||
"""Updates hashtag categories based upon an rss feed
|
"""Updates hashtag categories based upon an rss feed
|
||||||
"""
|
"""
|
||||||
|
@ -232,8 +232,9 @@ def xml2StrToHashtagCategories(baseDir: str, xmlStr: str,
|
||||||
if not hashtagListStr:
|
if not hashtagListStr:
|
||||||
continue
|
continue
|
||||||
hashtagList = hashtagListStr.split(' ')
|
hashtagList = hashtagListStr.split(' ')
|
||||||
for hashtag in hashtagList:
|
if not isBlockedHashtag(baseDir, categoryStr):
|
||||||
setHashtagCategory(baseDir, hashtag, categoryStr)
|
for hashtag in hashtagList:
|
||||||
|
setHashtagCategory(baseDir, hashtag, categoryStr)
|
||||||
|
|
||||||
|
|
||||||
def xml2StrToDict(baseDir: str, domain: str, xmlStr: str,
|
def xml2StrToDict(baseDir: str, domain: str, xmlStr: str,
|
||||||
|
@ -247,7 +248,7 @@ def xml2StrToDict(baseDir: str, domain: str, xmlStr: str,
|
||||||
return {}
|
return {}
|
||||||
result = {}
|
result = {}
|
||||||
if '<title>#categories</title>' in xmlStr:
|
if '<title>#categories</title>' in xmlStr:
|
||||||
xml2StrToHashtagCategories(baseDir, xmlStr,
|
xml2StrToHashtagCategories(baseDir, domain, xmlStr,
|
||||||
maxCategoriesFeedItemSizeKb)
|
maxCategoriesFeedItemSizeKb)
|
||||||
return {}
|
return {}
|
||||||
rssItems = xmlStr.split('<item>')
|
rssItems = xmlStr.split('<item>')
|
||||||
|
|
Loading…
Reference in New Issue