Add all_novels route

This commit is contained in:
Rajarshee Chatterjee
2020-12-24 20:32:15 +05:30
parent 15e726fb1d
commit 749760344f
3 changed files with 44 additions and 10 deletions
+6 -10
View File
@@ -20,15 +20,7 @@ router.get("/novel/:novelUrl", (req, res) => {
.replace(/[\t\n]/g, "")
.trim();
// authorName = $(".author-content")
// .text()
// .replace(/[\t\n]/g, "")
// .trim();
// artistName = $(".artist-content")
// .text()
// .replace(/[\t\n]/g, "")
// .trim();
novelCover = $(".summary_image > a > img").attr("src");
let novelDetails = {};
@@ -47,6 +39,8 @@ router.get("/novel/:novelUrl", (req, res) => {
novelDetails[detailName] = detail;
});
novelSummary = $(".c_000").text();
let novelChapters = [];
$(".wp-manga-chapter").each(function (result) {
@@ -62,13 +56,15 @@ router.get("/novel/:novelUrl", (req, res) => {
.replace(/[\t\n]/g, "")
.trim();
chapterUrl = $(this).find("a").attr("href");
chapterUrl = $(this).find("a").attr("href").replace(baseUrl, "");
novelChapters.push({ chapterName, releaseDate, chapterUrl });
});
novel = {
novelName,
novelCover,
novelSummary,
novelDetails,
novelChapters,
};