|
@@ -6,7 +6,7 @@ import json
|
|
|
from tqdm import tqdm
|
|
|
from pandas import DataFrame
|
|
|
from argparse import ArgumentParser
|
|
|
-from datetime import datetime, timedelta
|
|
|
+from datetime import datetime
|
|
|
|
|
|
from applications import DeNetMysql, PQMySQL, longArticlesMySQL, bot, Functions
|
|
|
from applications.const import updateAccountReadRateTaskConst
|
|
@@ -14,9 +14,9 @@ from config import apolloConfig
|
|
|
|
|
|
const = updateAccountReadRateTaskConst()
|
|
|
config = apolloConfig()
|
|
|
-unauthorized_account = json.loads(config.getConfigValue("unauthed_account_fans"))
|
|
|
+unauthorized_account = json.loads(config.getConfigValue("unauthorized_gh_id_fans"))
|
|
|
functions = Functions()
|
|
|
-read_rate_table = "long_articles_read_rate"
|
|
|
+read_rate_table = "long_articles_read_rate_dev"
|
|
|
|
|
|
|
|
|
def filter_outlier_data(group, key='show_view_count'):
|
|
@@ -150,8 +150,7 @@ def cal_account_read_rate(gh_id_tuple) -> DataFrame:
|
|
|
dt = functions.timestamp_to_str(timestamp=line['publish_timestamp'], string_format='%Y-%m-%d')
|
|
|
fans = fans_dict_each_day.get(gh_id, {}).get(dt, 0)
|
|
|
if not fans:
|
|
|
- account_name = line['accountName']
|
|
|
- fans = int(unauthorized_account.get(account_name, 0))
|
|
|
+ fans = int(unauthorized_account.get(gh_id, 0))
|
|
|
line['fans'] = fans
|
|
|
if fans > 1000:
|
|
|
line['readRate'] = line['show_view_count'] / fans if fans else 0
|