|
@@ -1,9 +1,12 @@
|
|
|
"""
|
|
|
@author: luojunhui
|
|
|
"""
|
|
|
+import traceback
|
|
|
from argparse import ArgumentParser
|
|
|
|
|
|
+from applications import bot
|
|
|
from coldStartTasks.crawler.wechat import ArticleAssociationCrawler
|
|
|
+from coldStartTasks.publish.publish_article_association_articles import ArticleAssociationPublish
|
|
|
|
|
|
|
|
|
def main():
|
|
@@ -18,9 +21,32 @@ def main():
|
|
|
biz_date = args.biz_date
|
|
|
else:
|
|
|
biz_date = None
|
|
|
+ try:
|
|
|
+ article_association_crawler = ArticleAssociationCrawler()
|
|
|
+ article_association_crawler.deal(biz_date=biz_date)
|
|
|
+ except Exception as e:
|
|
|
+ bot(
|
|
|
+ title="It occurred an Exception in ArticleAssociationCrawler",
|
|
|
+ detail={
|
|
|
+ "Error": str(e),
|
|
|
+ "Traceback": traceback.format_exc()
|
|
|
+ },
|
|
|
+ mention=False,
|
|
|
+ )
|
|
|
|
|
|
- article_association_crawler = ArticleAssociationCrawler()
|
|
|
- article_association_crawler.deal(biz_date=biz_date)
|
|
|
+ # publish
|
|
|
+ try:
|
|
|
+ article_association_publish = ArticleAssociationPublish()
|
|
|
+ article_association_publish.deal()
|
|
|
+ except Exception as e:
|
|
|
+ bot(
|
|
|
+ title="It occurred an Exception in ArticleAssociationPublish",
|
|
|
+ detail={
|
|
|
+ "Error": str(e),
|
|
|
+ "Traceback": traceback.format_exc()
|
|
|
+ },
|
|
|
+ mention=False,
|
|
|
+ )
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|