Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- added alias https://novelfull.com
- added alias https://novelfull.net
- lint tests ok (reached Wrote Zip to disk)
- unit tests passed (Tests completed in 631 milliseconds.
566 assertions of 566 passed, 0 failed.)
- added name to package.json and readme.md
  • Loading branch information
ktrin-u committed Apr 23, 2024
1 parent dcda723 commit d8ac1e0
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
{ "name": "Naheulf"},
{ "name": "perishableloc"},
{ "name": "praschke"},
{ "name": "ImmortalDreamer"}
{ "name": "ImmortalDreamer"},
{ "name": "ktrin"}
],
"license": "GPL-3.0-only",
"bugs": {
Expand Down
56 changes: 56 additions & 0 deletions plugin/js/parsers/NovelNextParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"use strict";

parserFactory.register("novelnext.com", () => new NovelNextParser());

class NovelNextParser extends Parser{
constructor() {
super();
}

getChapterUrls(dom) {
let chapters = NovelNextParser.extractChapterList(dom)
if (0 < chapters.length) {
return Promise.resolve(chapters);
}
return NovelNextParser.fetchChapterList(dom);
};

static fetchChapterList(dom) {
let novelId = dom.querySelector("div#rating").getAttribute("data-novel-id");
let url = `https://novelnext.com/novelnext/${novelId}`;
return HttpClient.wrapFetch(url).then(function (xhr) {
return NovelNextParser.extractChapterList(xhr.responseXML);
});
}

static extractChapterList(dom) {
return [...dom.querySelectorAll("ul.list-chapter a")]
.map(a => util.hyperLinkToChapter(a));
}

findContent(dom) {
return dom.querySelector("div#chr-content");
};

extractTitleImpl(dom) {
return dom.querySelector("h3.title");
};

extractAuthor(dom) {
let authorLabel = dom.querySelector("ul.info li:nth-of-type(2) a");
return (authorLabel === null) ? super.extractAuthor(dom) : authorLabel.textContent;
};

findChapterTitle(dom) {
return dom.querySelector("a.chr-title").textContent;
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, "div.book");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("div.desc-text")];
}

}
2 changes: 2 additions & 0 deletions plugin/js/parsers/NovelfullParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ parserFactory.register("novelfull.com", () => new NovelfullParser());
parserFactory.register("novelfull.net", () => new NovelfullParser());
parserFactory.register("novelfullbook.com", () => new NovelfullParser());
parserFactory.register("novelmax.net", () => new NovelfullParser());
parserFactory.register("novelnext.com", () => new NovelfullParser());
parserFactory.register("novelnext.net", () => new NovelfullParser());
parserFactory.register("noveltop1.org", () => new NovelfullParser());
parserFactory.register("noveltrust.net", () => new NovelfullParser());
parserFactory.register("novelusb.com", () => new NovelfullParser());
Expand Down
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ <h3>Instructions</h3>
<script src="js/parsers/NovelmaniaParser.js"></script>
<script src="js/parsers/NovelmediumParser.js"></script>
<script src="js/parsers/NovelNaverParser.js"></script>
<script src="js/parsers/NovelNextParser.js"></script>
<script src="js/parsers/NovelOnlineFreeParser.js"></script>
<script src="js/parsers/NovelonomiconParser.js"></script>
<script src="js/parsers/NovelpassionParser.js"></script>
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Credits
* perishableloc
* praschke
* ImmortalDreamer
* ktrin

## How to use with Baka-Tsuki:
* Browse to a Baka-Tsuki web page that has the full text of a story.
Expand Down

0 comments on commit d8ac1e0

Please sign in to comment.