|
@@ -3,53 +3,10 @@
|
|
@description: try to get some more accounts
|
|
@description: try to get some more accounts
|
|
"""
|
|
"""
|
|
|
|
|
|
-import datetime
|
|
|
|
-
|
|
|
|
-from applications.api.feishu_api import FeishuSheetApi
|
|
|
|
from tasks.crawler_accounts_by_association import ChannelsAccountCrawler
|
|
from tasks.crawler_accounts_by_association import ChannelsAccountCrawler
|
|
from tasks.crawler_accounts_by_association import ToutiaoAccountCrawler
|
|
from tasks.crawler_accounts_by_association import ToutiaoAccountCrawler
|
|
from tasks.crawler_accounts_by_association import HaoKanAccountCrawler
|
|
from tasks.crawler_accounts_by_association import HaoKanAccountCrawler
|
|
|
|
|
|
-document_token = "BGQCsOXwHhVRq5tswjgcI8NInqd"
|
|
|
|
-toutiao_sheet_id = "pIJSt7"
|
|
|
|
-channels_sheet_id = "ee0163"
|
|
|
|
-haokan_sheet_id = "tfftfD"
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-def insert_data_into_feishu_sheet(platform: str, data_list: list[list[str]]) -> None:
|
|
|
|
- """
|
|
|
|
- insert data info into feishu sheet
|
|
|
|
- :param platform: str, channels or toutiao
|
|
|
|
- :param data_list: list[list[str]],
|
|
|
|
- """
|
|
|
|
- video_array = [
|
|
|
|
- list(i) + [datetime.date.today().strftime("%Y-%m-%d")] for i in data_list
|
|
|
|
- ]
|
|
|
|
- feishu_sheet = FeishuSheetApi()
|
|
|
|
- feishu_sheet.fetch_token()
|
|
|
|
- match platform:
|
|
|
|
- case "toutiao":
|
|
|
|
- sheet_id = toutiao_sheet_id
|
|
|
|
- case "sph":
|
|
|
|
- sheet_id = channels_sheet_id
|
|
|
|
- case "hksp":
|
|
|
|
- sheet_id = haokan_sheet_id
|
|
|
|
- case _:
|
|
|
|
- raise RuntimeError("platform error")
|
|
|
|
-
|
|
|
|
- feishu_sheet.prepend_value(
|
|
|
|
- sheet_token=document_token,
|
|
|
|
- sheet_id=sheet_id,
|
|
|
|
- values=[["******"]],
|
|
|
|
- ranges="A2:A2",
|
|
|
|
- )
|
|
|
|
- feishu_sheet.insert_value(
|
|
|
|
- sheet_token=document_token,
|
|
|
|
- sheet_id=sheet_id,
|
|
|
|
- values=video_array,
|
|
|
|
- ranges="A2:J{}".format(2 + len(video_array)),
|
|
|
|
- )
|
|
|
|
-
|
|
|
|
|
|
|
|
def deal_each_platform(platform: str) -> None:
|
|
def deal_each_platform(platform: str) -> None:
|
|
"""
|
|
"""
|