Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions src/all/AnyWeb.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- {"id": 23119214, "ver": "1.0.1", "libVer": "1.0.0", "author": "wasu-code", "dep": ["Readability>=1.0.0", "url", "unhtml"]}
-- {"id": 23119214, "ver": "1.0.2", "libVer": "1.0.0", "author": "wasu-code", "dep": ["Readability>=1.0.0", "url", "unhtml"]}

local parseArticle = Require("Readability").parse
local qs = Require("url").querystring
Expand Down Expand Up @@ -31,24 +31,12 @@ local function parseNovelUpdatesChapters(doc)
)
)

local chapters = filter(
map(
doc2:select("a[href]"),
function(card)
if card:hasAttr("data-id") then
local span = card:selectFirst("span")
if span then
return NovelChapter {
title = span:attr("title"),
link = "https:" .. card:attr("href"),
}
end
end
return nil -- will be filtered out
end
),
function(chapter)
return chapter ~= nil
local chapters = map(doc2:select("a[href][data-id]"),
function(card)
return NovelChapter {
title = card:selectFirst("span"):attr("title"),
link = "https:" .. card:attr("href"),
}
end
)

Expand Down