Skip to content

Commit

Permalink
[Feat]: 时间线BUG Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
why committed Jan 1, 2024
1 parent 65424fd commit 73be2b8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ fun parserTimelineText(item: Element, entity: TimelineEntity) {
*/
private fun Elements.fetchTimeAndPlatform(entity: TimelineEntity) {
val actions = select(".post_actions")
val commentA = select("a[class=tml_comment]").remove()
val commentA = select("a.tml_comment")
val a = select("a").remove()
val timeInfo = actions.text().split("·").filter { it.isNotBlank() }
val time = timeInfo.getOrNull(0).orEmpty().trim()
val platform = timeInfo.getOrNull(1).orEmpty().trim()
Expand All @@ -184,7 +185,7 @@ private fun Elements.fetchTimeAndPlatform(entity: TimelineEntity) {
entity.platform = platform
entity.isSpitOut = commentA.isNotEmpty()
entity.commentCount = commentA.text().parseCount()
entity.commentUserId = "user/(.*?)/timeline".toRegex().groupValueOne(commentA.attr("href"))
entity.commentUserId = "user/(.*?)/timeline".toRegex().groupValueOne(a.attr("href"))

if (entity.userId.isBlank()) {
entity.userId = entity.commentUserId
Expand Down

0 comments on commit 73be2b8

Please sign in to comment.