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
Chengyang Zhong
crawler
Commits
1459da5a
Commit
1459da5a
authored
Aug 14, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
133175f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
crawler_week_report.py
tasks/crawler_week_report.py
+5
-5
No files found.
tasks/crawler_week_report.py
View file @
1459da5a
...
...
@@ -8,9 +8,9 @@
import
pymysql
import
xlwt
,
datetime
from
maintenance.func_send_email_with_file
import
send_file_email
import
zipfile
#
import zipfile
import
redis
from
pyhive
import
hive
#
from pyhive import hive
from
maintenance.func_send_email_with_file
import
send_file_email
from
typing
import
Dict
,
List
from
elasticsearch
import
Elasticsearch
...
...
@@ -385,7 +385,7 @@ def get_how_word_crawler_count(data_index, start_ts, end_ts, week_num, last_week
return
res_data
def
get_keyword_ctr
(
hive
,
start_ts
,
end_ts
):
def
get_keyword_ctr
(
start_ts
,
end_ts
):
start_date
=
datetime
.
datetime
.
fromtimestamp
(
start_ts
/
1e3
)
end_date
=
datetime
.
datetime
.
fromtimestamp
(
end_ts
/
1e3
)
start_date_str
=
start_date
.
strftime
(
"
%
Y
%
m
%
d"
)
...
...
@@ -474,4 +474,4 @@ if __name__ == "__main__":
# exl.save_excel(path)
# print(u'创建demo.xls文件成功')
# send_email_tome()
word_count
=
get_keyword_ctr
(
hive
,
start_ts
,
end_ts
)
\ No newline at end of file
word_count
=
get_keyword_ctr
(
start_ts
,
end_ts
)
\ No newline at end of file
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