|
@@ -9,7 +9,8 @@ import traceback
|
|
|
|
|
|
from pandas import DataFrame
|
|
from pandas import DataFrame
|
|
|
|
|
|
-from applications import aiditApi, log, bot
|
|
|
|
|
|
+from applications import log, bot
|
|
|
|
+from applications.api import aidit_api
|
|
from config import apolloConfig
|
|
from config import apolloConfig
|
|
|
|
|
|
apollo = apolloConfig()
|
|
apollo = apolloConfig()
|
|
@@ -107,7 +108,7 @@ class CategoryColdStartTask(object):
|
|
"""
|
|
"""
|
|
plan_id = self.category_map.get(category)
|
|
plan_id = self.category_map.get(category)
|
|
if plan_id:
|
|
if plan_id:
|
|
- article_list = aiditApi.get_generated_article_list(plan_id)
|
|
|
|
|
|
+ article_list = aidit_api.get_generated_article_list(plan_id)
|
|
title_list = [i[1] for i in article_list]
|
|
title_list = [i[1] for i in article_list]
|
|
if title_list:
|
|
if title_list:
|
|
# update
|
|
# update
|
|
@@ -227,7 +228,7 @@ class CategoryColdStartTask(object):
|
|
)
|
|
)
|
|
if url_list:
|
|
if url_list:
|
|
# create_crawler_plan
|
|
# create_crawler_plan
|
|
- crawler_plan_response = aiditApi.auto_create_crawler_task(
|
|
|
|
|
|
+ crawler_plan_response = aidit_api.auto_create_crawler_task(
|
|
plan_id=None,
|
|
plan_id=None,
|
|
plan_name="自动绑定-{}--{}--{}".format(category, datetime.date.today().__str__(), len(url_list)),
|
|
plan_name="自动绑定-{}--{}--{}".format(category, datetime.date.today().__str__(), len(url_list)),
|
|
plan_tag="品类冷启动",
|
|
plan_tag="品类冷启动",
|
|
@@ -259,7 +260,7 @@ class CategoryColdStartTask(object):
|
|
"inputSourceChannel": 5
|
|
"inputSourceChannel": 5
|
|
}
|
|
}
|
|
]
|
|
]
|
|
- generate_plan_response = aiditApi.bind_crawler_task_to_generate_task(
|
|
|
|
|
|
+ generate_plan_response = aidit_api.bind_crawler_task_to_generate_task(
|
|
crawler_task_list=new_crawler_task_list,
|
|
crawler_task_list=new_crawler_task_list,
|
|
generate_task_id=self.category_map[category]
|
|
generate_task_id=self.category_map[category]
|
|
)
|
|
)
|