Commit 3b8ad835 authored by litaolemo's avatar litaolemo

update

parent 60ba8678
...@@ -314,8 +314,6 @@ def get_how_word_crawler_count(data_index, start_ts, end_ts, week_num, last_week ...@@ -314,8 +314,6 @@ def get_how_word_crawler_count(data_index, start_ts, end_ts, week_num, last_week
def craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, year): def craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, year):
tag_names_list_week = [] tag_names_list_week = []
all_data_week = []
date = datetime.datetime.fromtimestamp(start_ts/1e3)
one_month_ago = datetime.datetime.now().date() - datetime.timedelta(days=30) one_month_ago = datetime.datetime.now().date() - datetime.timedelta(days=30)
search_keyword_dict = get_search_keywrod_dict() search_keyword_dict = get_search_keywrod_dict()
sql = 'select keywords,sum(sorted) as nums,sum(uv) as uvs from api_search_words where is_delete = 0 and create_time >= "' + str( sql = 'select keywords,sum(sorted) as nums,sum(uv) as uvs from api_search_words where is_delete = 0 and create_time >= "' + str(
...@@ -338,13 +336,18 @@ def craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, y ...@@ -338,13 +336,18 @@ def craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, y
tractate_content_num = get_es_word(word,start_ts) tractate_content_num = get_es_word(word,start_ts)
new_line = [word,"" ,sorteds,uv] new_line = [word,"" ,sorteds,uv]
tag_names_list_week.append(tuple(new_line+tractate_content_num)) tag_names_list_week.append(tuple(new_line+tractate_content_num))
for word in search_keyword_dict:
tractate_content_num = get_es_word(word, start_ts)
if tractate_content_num[0] != 0:
new_line = ["", "", "", ""]
tag_names_list_week.append(tuple(new_line + tractate_content_num))
return tag_names_list_week return tag_names_list_week
if __name__ == "__main__": if __name__ == "__main__":
data_index, start_ts, end_ts, week_num, last_week_num, year = week_num() data_index, start_ts, end_ts, week_num, last_week_num, year = week_num()
# 一周爬虫抓取热点数 # 一周爬虫抓取热点数
craw_one_week = get_how_word_crawler_count(data_index, start_ts, end_ts, week_num, last_week_num, year) craw_one_week = get_how_word_crawler_count(data_index, start_ts, end_ts, week_num, last_week_num, year)
print(craw_one_week)
# query 一周抓取详情 # query 一周抓取详情
all_data_week = craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, year ) all_data_week = craw_query_one_week(data_index, start_ts, end_ts, week_num, last_week_num, year )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment