From 7fe240d119caf321595436cf30d3f7129fece37a Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 11:59:54 -0700 Subject: [PATCH 01/15] test func --- src/plugins/english/novelupdates.ts | 54 +++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 1b159778f..db542eb96 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -184,6 +184,60 @@ class NovelUpdates implements Plugin.PluginBase { return novel; } + async getBody(novelPath: string) { + const url = this.site + novelPath; + const result = await fetchApi(url); + const body = await result.text(); + + let loadedCheerio = parseHTML(body); + + const novel: Plugin.SourceNovel = { + path: novelPath, + name: loadedCheerio('.seriestitlenu').text() || 'Untitled', + cover: loadedCheerio('.wpb_wrapper img').attr('src'), + chapters: [], + }; + + novel.author = loadedCheerio('#authtag') + .map((i, el) => loadedCheerio(el).text().trim()) + .toArray() + .join(', '); + + novel.genres = loadedCheerio('#seriesgenre') + .children('a') + .map((i, el) => loadedCheerio(el).text()) + .toArray() + .join(','); + + novel.status = loadedCheerio('#editstatus').text().includes('Ongoing') + ? 'Ongoing' + : 'Completed'; + + const type = loadedCheerio('#showtype').text().trim(); + + const summary = loadedCheerio('#editdescription').text().trim(); + + novel.summary = summary + `\n\nType: ${type}`; + + const chapter: Plugin.ChapterItem[] = []; + + const novelId = loadedCheerio('input#mypostid').attr('value')!; + + const formData = new FormData(); + formData.append('action', 'nd_getchapters'); + formData.append('mygrr', '0'); + formData.append('mypostid', novelId); + + const link = `${this.site}wp-admin/admin-ajax.php`; + + const text = await fetchApi(link, { + method: 'POST', + body: formData, + }).then(data => data.text()); + + return text; + } + getLocation(href: string) { const match = href.match( /^(https?:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/, From 52f907161bfa6e571bae535478e2f6dd996a236e Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 12:00:13 -0700 Subject: [PATCH 02/15] update version --- src/plugins/english/novelupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index db542eb96..16dc2a290 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.7.9'; + version = '0.8.1'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; From ae76e49e10ecacb7d3906a41cf09d84c656abf6d Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 12:29:35 -0700 Subject: [PATCH 03/15] new way --- src/plugins/english/novelupdates.ts | 85 ++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 27 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 16dc2a290..c39fa053a 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.1'; + version = '0.8.2'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -143,19 +143,41 @@ class NovelUpdates implements Plugin.PluginBase { const novelId = loadedCheerio('input#mypostid').attr('value')!; - const formData = new FormData(); - formData.append('action', 'nd_getchapters'); - formData.append('mygrr', '0'); - formData.append('mypostid', novelId); - - const link = `${this.site}wp-admin/admin-ajax.php`; - - const text = await fetchApi(link, { - method: 'POST', - body: formData, - }).then(data => data.text()); - - loadedCheerio = parseHTML(text); + // const formData = new FormData(); + // formData.append('action', 'nd_getchapters'); + // formData.append('mygrr', '0'); + // formData.append('mypostid', novelId); + + // const link = `${this.site}wp-admin/admin-ajax.php`; + + // const text = await fetchApi(link, { + // method: 'POST', + // body: formData, + // }).then(data => data.text()); + + // loadedCheerio = parseHTML(text); + + // const nameReplacements: Record = { + // 'v': 'volume ', + // 'c': ' chapter ', + // 'part': 'part ', + // 'ss': 'SS', + // }; + + // loadedCheerio('li.sp_li_chp').each((i, el) => { + // let chapterName = loadedCheerio(el).text(); + // for (const name in nameReplacements) { + // chapterName = chapterName.replace(name, nameReplacements[name]); + // } + // chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); + // const chapterUrl = + // 'https:' + loadedCheerio(el).find('a').first().next().attr('href'); + + // chapter.push({ + // name: chapterName, + // path: chapterUrl.replace(this.site, ''), + // }); + // }); const nameReplacements: Record = { 'v': 'volume ', @@ -164,20 +186,29 @@ class NovelUpdates implements Plugin.PluginBase { 'ss': 'SS', }; - loadedCheerio('li.sp_li_chp').each((i, el) => { - let chapterName = loadedCheerio(el).text(); - for (const name in nameReplacements) { - chapterName = chapterName.replace(name, nameReplacements[name]); - } - chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); - const chapterUrl = - 'https:' + loadedCheerio(el).find('a').first().next().attr('href'); - - chapter.push({ - name: chapterName, - path: chapterUrl.replace(this.site, ''), + loadedCheerio('#myTable.tbody') + .find('tr') + .each((i, el) => { + let chapterName = loadedCheerio(el).find('td').first().next().text(); + for (const name in nameReplacements) { + chapterName = chapterName.replace(name, nameReplacements[name]); + } + chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); + const chapterUrl = + 'https:' + + loadedCheerio(el) + .find('td') + .first() + .next() + .find('a') + .first() + .attr('href'); + + chapter.push({ + name: chapterName, + path: chapterUrl.replace(this.site, ''), + }); }); - }); novel.chapters = chapter.reverse(); From 01f0a89f5c48c586da5117e795e0f89610dd8e3c Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 12:40:59 -0700 Subject: [PATCH 04/15] update method --- src/plugins/english/novelupdates.ts | 72 ++++++++++++++++++----------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index c39fa053a..51e67753e 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.2'; + version = '0.8.3'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -139,9 +139,9 @@ class NovelUpdates implements Plugin.PluginBase { novel.summary = summary + `\n\nType: ${type}`; - const chapter: Plugin.ChapterItem[] = []; + const chapters: Plugin.ChapterItem[] = []; - const novelId = loadedCheerio('input#mypostid').attr('value')!; + // const novelId = loadedCheerio('input#mypostid').attr('value')!; // const formData = new FormData(); // formData.append('action', 'nd_getchapters'); @@ -186,31 +186,51 @@ class NovelUpdates implements Plugin.PluginBase { 'ss': 'SS', }; - loadedCheerio('#myTable.tbody') - .find('tr') - .each((i, el) => { - let chapterName = loadedCheerio(el).find('td').first().next().text(); - for (const name in nameReplacements) { - chapterName = chapterName.replace(name, nameReplacements[name]); - } - chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); - const chapterUrl = - 'https:' + - loadedCheerio(el) - .find('td') - .first() - .next() - .find('a') - .first() - .attr('href'); - - chapter.push({ - name: chapterName, - path: chapterUrl.replace(this.site, ''), - }); + loadedCheerio('#myTable tbody tr').each((index, element) => { + const chapterTitle = loadedCheerio(element) + .find('td') + .first() + .text() + .trim(); + const chapterLink = + 'https:' + loadedCheerio(element).find('td a').attr('href'); + + chapters.push({ + name: chapterTitle, + path: chapterLink?.replace(this.site, ''), }); + }); + + novel.chapters = chapters.reverse(); + + // Log the extracted chapters + console.log(chapters); + + // loadedCheerio('#myTable.tbody') + // .find('tr') + // .each((i, el) => { + // let chapterName = loadedCheerio(el).find('td').first().next().text(); + // for (const name in nameReplacements) { + // chapterName = chapterName.replace(name, nameReplacements[name]); + // } + // chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); + // const chapterUrl = + // 'https:' + + // loadedCheerio(el) + // .find('td') + // .first() + // .next() + // .find('a') + // .first() + // .attr('href'); + + // chapter.push({ + // name: chapterName, + // path: chapterUrl.replace(this.site, ''), + // }); + // }); - novel.chapters = chapter.reverse(); + // novel.chapters = chapter.reverse(); return novel; } From 1050b179f2b1c9d018c6699ec5e697cdd9ebbacd Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 12:56:47 -0700 Subject: [PATCH 05/15] fix cheerio --- src/plugins/english/novelupdates.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 51e67753e..f05cac166 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.3'; + version = '0.8.4'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -188,12 +188,13 @@ class NovelUpdates implements Plugin.PluginBase { loadedCheerio('#myTable tbody tr').each((index, element) => { const chapterTitle = loadedCheerio(element) - .find('td') + .find('td a') .first() + .next() .text() .trim(); const chapterLink = - 'https:' + loadedCheerio(element).find('td a').attr('href'); + 'https:' + loadedCheerio(element).find('td a').next().attr('href'); chapters.push({ name: chapterTitle, From 821381380d9e6a02593c5d8152a0b902747762be Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:01:46 -0700 Subject: [PATCH 06/15] update --- src/plugins/english/novelupdates.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index f05cac166..019322be7 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -188,13 +188,15 @@ class NovelUpdates implements Plugin.PluginBase { loadedCheerio('#myTable tbody tr').each((index, element) => { const chapterTitle = loadedCheerio(element) - .find('td a') + .find('td') .first() .next() + .find('a') .text() .trim(); const chapterLink = - 'https:' + loadedCheerio(element).find('td a').next().attr('href'); + 'https:' + + loadedCheerio(element).find('td').next().find('a').attr('href'); chapters.push({ name: chapterTitle, From 01c998cb4e01622fd1e6f90a0d96574b7cf53de4 Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:02:28 -0700 Subject: [PATCH 07/15] update --- src/plugins/english/novelupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 019322be7..87ec28fd4 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -196,7 +196,7 @@ class NovelUpdates implements Plugin.PluginBase { .trim(); const chapterLink = 'https:' + - loadedCheerio(element).find('td').next().find('a').attr('href'); + loadedCheerio(element).find('td').first().next().find('a').attr('href'); chapters.push({ name: chapterTitle, From df12b44ef406d823e99439f1086432ab959cc420 Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:08:04 -0700 Subject: [PATCH 08/15] add next --- src/plugins/english/novelupdates.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 87ec28fd4..236cd2627 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.4'; + version = '0.8.5'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -191,12 +191,19 @@ class NovelUpdates implements Plugin.PluginBase { .find('td') .first() .next() + .next() .find('a') .text() .trim(); const chapterLink = 'https:' + - loadedCheerio(element).find('td').first().next().find('a').attr('href'); + loadedCheerio(element) + .find('td') + .first() + .next() + .next() + .find('a') + .attr('href'); chapters.push({ name: chapterTitle, From d7293cc5512fd335eeb7a3eccccb0a2928b5ee11 Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:30:37 -0700 Subject: [PATCH 09/15] add multi page --- src/plugins/english/novelupdates.ts | 91 ++++++++++++++--------------- 1 file changed, 44 insertions(+), 47 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 236cd2627..5a4112f95 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.5'; + version = '0.8.6'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -186,62 +186,59 @@ class NovelUpdates implements Plugin.PluginBase { 'ss': 'SS', }; - loadedCheerio('#myTable tbody tr').each((index, element) => { - const chapterTitle = loadedCheerio(element) - .find('td') - .first() - .next() - .next() - .find('a') - .text() - .trim(); - const chapterLink = - 'https:' + - loadedCheerio(element) + let maxPageString = loadedCheerio('.digg_pagination') + .find('a') + .last() + .prev() + .text(); + let maxPage = 0; + if (maxPageString.length > 0) { + maxPage = parseInt(maxPageString); + } + + for (let curPage = maxPage; curPage >= 0; curPage--) { + const url = this.site + novelPath + '?pg=' + curPage; + const result = await fetchApi(url); + const body = await result.text(); + + let loadedCheerio = parseHTML(body); + + loadedCheerio('#myTable tbody tr').each((index, element) => { + let chapterTitle = loadedCheerio(element) .find('td') .first() .next() .next() .find('a') - .attr('href'); + .text() + .trim(); - chapters.push({ - name: chapterTitle, - path: chapterLink?.replace(this.site, ''), + for (const name in nameReplacements) { + chapterTitle = chapterTitle.replace(name, nameReplacements[name]); + } + chapterTitle = chapterTitle + .replace(/\b\w/g, l => l.toUpperCase()) + .trim(); + + const chapterLink = + 'https:' + + loadedCheerio(element) + .find('td') + .first() + .next() + .next() + .find('a') + .attr('href'); + + chapters.push({ + name: chapterTitle, + path: chapterLink?.replace(this.site, ''), + }); }); - }); + } novel.chapters = chapters.reverse(); - // Log the extracted chapters - console.log(chapters); - - // loadedCheerio('#myTable.tbody') - // .find('tr') - // .each((i, el) => { - // let chapterName = loadedCheerio(el).find('td').first().next().text(); - // for (const name in nameReplacements) { - // chapterName = chapterName.replace(name, nameReplacements[name]); - // } - // chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); - // const chapterUrl = - // 'https:' + - // loadedCheerio(el) - // .find('td') - // .first() - // .next() - // .find('a') - // .first() - // .attr('href'); - - // chapter.push({ - // name: chapterName, - // path: chapterUrl.replace(this.site, ''), - // }); - // }); - - // novel.chapters = chapter.reverse(); - return novel; } From cca05021dd37ea8f201a34872361e03e54889514 Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:38:34 -0700 Subject: [PATCH 10/15] fix order --- src/plugins/english/novelupdates.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 5a4112f95..ae0e29702 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.6'; + version = '0.8.7'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -191,12 +191,12 @@ class NovelUpdates implements Plugin.PluginBase { .last() .prev() .text(); - let maxPage = 0; + let maxPage = 1; if (maxPageString.length > 0) { maxPage = parseInt(maxPageString); } - for (let curPage = maxPage; curPage >= 0; curPage--) { + for (let curPage = 1; curPage <= maxPage; curPage++) { const url = this.site + novelPath + '?pg=' + curPage; const result = await fetchApi(url); const body = await result.text(); From 76d76e51d7f96948262cdeb04392a3a3c0380c2b Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:54:40 -0700 Subject: [PATCH 11/15] fix version --- src/plugins/english/novelupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index ae0e29702..eff814f7e 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.7'; + version = '0.8.0'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; From 4ce9410bec891bb813e93d739954c7219a4e11ad Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 13:55:11 -0700 Subject: [PATCH 12/15] remove test func --- src/plugins/english/novelupdates.ts | 54 ----------------------------- 1 file changed, 54 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index eff814f7e..d7b46a05f 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -242,60 +242,6 @@ class NovelUpdates implements Plugin.PluginBase { return novel; } - async getBody(novelPath: string) { - const url = this.site + novelPath; - const result = await fetchApi(url); - const body = await result.text(); - - let loadedCheerio = parseHTML(body); - - const novel: Plugin.SourceNovel = { - path: novelPath, - name: loadedCheerio('.seriestitlenu').text() || 'Untitled', - cover: loadedCheerio('.wpb_wrapper img').attr('src'), - chapters: [], - }; - - novel.author = loadedCheerio('#authtag') - .map((i, el) => loadedCheerio(el).text().trim()) - .toArray() - .join(', '); - - novel.genres = loadedCheerio('#seriesgenre') - .children('a') - .map((i, el) => loadedCheerio(el).text()) - .toArray() - .join(','); - - novel.status = loadedCheerio('#editstatus').text().includes('Ongoing') - ? 'Ongoing' - : 'Completed'; - - const type = loadedCheerio('#showtype').text().trim(); - - const summary = loadedCheerio('#editdescription').text().trim(); - - novel.summary = summary + `\n\nType: ${type}`; - - const chapter: Plugin.ChapterItem[] = []; - - const novelId = loadedCheerio('input#mypostid').attr('value')!; - - const formData = new FormData(); - formData.append('action', 'nd_getchapters'); - formData.append('mygrr', '0'); - formData.append('mypostid', novelId); - - const link = `${this.site}wp-admin/admin-ajax.php`; - - const text = await fetchApi(link, { - method: 'POST', - body: formData, - }).then(data => data.text()); - - return text; - } - getLocation(href: string) { const match = href.match( /^(https?:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/, From d90186ae29f66b116cf5ce57ba389f90e7589e48 Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 14:00:13 -0700 Subject: [PATCH 13/15] update version --- src/plugins/english/novelupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index d7b46a05f..8c304bd8a 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.0'; + version = '0.8.7'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; From 87f6d1b8c5d19713f0baf82f14e139917036e57e Mon Sep 17 00:00:00 2001 From: nguyd1 Date: Wed, 2 Oct 2024 14:13:17 -0700 Subject: [PATCH 14/15] remove comments --- src/plugins/english/novelupdates.ts | 38 ----------------------------- 1 file changed, 38 deletions(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 8c304bd8a..5aa774e80 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -141,44 +141,6 @@ class NovelUpdates implements Plugin.PluginBase { const chapters: Plugin.ChapterItem[] = []; - // const novelId = loadedCheerio('input#mypostid').attr('value')!; - - // const formData = new FormData(); - // formData.append('action', 'nd_getchapters'); - // formData.append('mygrr', '0'); - // formData.append('mypostid', novelId); - - // const link = `${this.site}wp-admin/admin-ajax.php`; - - // const text = await fetchApi(link, { - // method: 'POST', - // body: formData, - // }).then(data => data.text()); - - // loadedCheerio = parseHTML(text); - - // const nameReplacements: Record = { - // 'v': 'volume ', - // 'c': ' chapter ', - // 'part': 'part ', - // 'ss': 'SS', - // }; - - // loadedCheerio('li.sp_li_chp').each((i, el) => { - // let chapterName = loadedCheerio(el).text(); - // for (const name in nameReplacements) { - // chapterName = chapterName.replace(name, nameReplacements[name]); - // } - // chapterName = chapterName.replace(/\b\w/g, l => l.toUpperCase()).trim(); - // const chapterUrl = - // 'https:' + loadedCheerio(el).find('a').first().next().attr('href'); - - // chapter.push({ - // name: chapterName, - // path: chapterUrl.replace(this.site, ''), - // }); - // }); - const nameReplacements: Record = { 'v': 'volume ', 'c': ' chapter ', From cdbe6f02ea2d36b172504817bb65c1abf6599f77 Mon Sep 17 00:00:00 2001 From: nguyd1 <91645046+nguyd1@users.noreply.github.com> Date: Fri, 4 Oct 2024 06:44:03 -0700 Subject: [PATCH 15/15] Update src/plugins/english/novelupdates.ts Co-authored-by: Rajarshee Chatterjee --- src/plugins/english/novelupdates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 5aa774e80..3d4b81d0b 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.8.7'; + version = '0.8.0'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/';