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
cfc1ffa6
Commit
cfc1ffa6
authored
Sep 23, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e42f876c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
cal_ni_and_put_to_backend.py
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
+6
-6
No files found.
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
View file @
cfc1ffa6
...
...
@@ -96,7 +96,7 @@ class push_rule(object):
else
:
repost_diff
=
-
100
print
(
datetime
.
datetime
.
now
()
.
timestamp
(),
fetch_time_last
,
fetch_time
,
comment_diff
,
favoratie_diff
,
repost_diff
)
#
print(datetime.datetime.now().timestamp(),fetch_time_last,fetch_time,comment_diff,favoratie_diff,repost_diff)
if
parse_mode
==
"and"
:
if
comment_diff
/
time_diff
>=
self
.
comment_per_min
and
favoratie_diff
/
time_diff
>=
self
.
favorite_per_min
and
repost_diff
/
time_diff
>=
self
.
repost_per_min
:
return
True
...
...
@@ -117,20 +117,20 @@ def scan_from_redis(push_rule_class_list) -> Dict:
set_name
=
"exists_doc_id_set_
%
s"
%
datetime
.
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d"
)
rds
.
sadd
(
set_name
,
"test"
)
rds
.
expire
(
set_name
,
259200
)
out_ts
=
datetime
.
datetime
.
now
()
.
timestamp
()
*
1e3
-
86400000
doc_id
=
rds
.
lpop
(
"doc_id"
)
if
doc_id
:
res
=
rds
.
llen
(
doc_id
)
if
res
<
2
:
count_
res
=
rds
.
llen
(
doc_id
)
if
count_
res
<
2
:
continue
res_list
=
rds
.
lrange
(
doc_id
,
0
,
1
)
fetch_time
=
0
repost_count
=
0
comment_count
=
0
favorite_count
=
0
for
count
,
re
in
enumerate
(
res_list
):
for
count
,
res
in
enumerate
(
res_list
):
print
(
res
)
out_ts
=
datetime
.
datetime
.
now
()
.
timestamp
()
*
1e3
-
86400000
one_data
=
json
.
loads
(
re
)
one_data
=
json
.
loads
(
re
s
)
if
count
==
0
:
fetch_time
=
one_data
.
get
(
"fetch_time"
)
repost_count
=
one_data
.
get
(
"repost_count"
)
...
...
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