Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
crawler
Commits
3b8ad835
Commit
3b8ad835
authored
4 years ago
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
60ba8678
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
crawler_week_report.py
tasks/crawler_week_report.py
+6
-3
No files found.
tasks/crawler_week_report.py
View file @
3b8ad835
...
...
@@ -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
):
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
)
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
(
...
...
@@ -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
)
new_line
=
[
word
,
""
,
sorteds
,
uv
]
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
if
__name__
==
"__main__"
:
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
)
print
(
craw_one_week
)
# query 一周抓取详情
all_data_week
=
craw_query_one_week
(
data_index
,
start_ts
,
end_ts
,
week_num
,
last_week_num
,
year
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment