Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
kpt
2024-07-03 20:16:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e96d14dd21f934a80494fc00328ad6dfad6f9061
e96d14dd
1 parent
4b1af050
【getTopicPageData】话题工具类
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
utils/getTopicPageData.py
utils/getTopicPageData.py
0 → 100644
View file @
e96d14d
from
utils.getPublicData
import
*
def
getTopicLen
(
topic
):
# 统计特定话题下的评论数目
commentsList
=
getAllCommentsData
()
topic_len
=
0
for
i
in
commentsList
:
if
i
[
9
]
==
topic
:
topicLen
+=
1
return
topic_len
def
getTopicPageCreatedAtCharData
(
topic
):
# 统计包含特定热词的评论在每个日期的数量,并返回日期和对应的评论数量
commentsList
=
getAllCommentsData
()
createdAt
=
{}
for
i
in
commentsList
:
if
i
[
9
]
==
topic
:
if
i
[
1
]
in
createdAt
.
keys
():
createdAt
[
i
[
1
]]
+=
1
else
:
createdAt
[
i
[
1
]]
=
1
return
list
(
createdAt
.
keys
()),
list
(
createdAt
.
values
())
def
getCommentFilterData
(
topic
):
# 筛选包含特定热词的评论并返回这些评论的数据
commentsList
=
getAllCommentsData
()
commentData
=
[]
for
i
in
commentsList
:
if
i
[
9
]
==
topic
:
commentData
.
append
(
i
)
return
commentData
\ No newline at end of file
...
...
Please
register
or
login
to post a comment