Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
See: #740
  • Loading branch information
dteviot committed May 24, 2022
1 parent 0a7a79e commit 829f9de
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
34 changes: 34 additions & 0 deletions plugin/js/parsers/SpiritfanfictionParser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use strict";

parserFactory.register("spiritfanfiction.com", () => new SpiritfanfictionParser());

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

async getChapterUrls(dom) {
let menu = dom.querySelector("table.listagemCapitulos");
return util.hyperlinksToChapterList(menu);
}

findContent(dom) {
return dom.querySelector("div.texto-capitulo");
}

extractTitleImpl(dom) {
return dom.querySelector("h1.tituloPrincipal");
}

findChapterTitle(dom) {
return dom.querySelector("h1.tituloPrincipal");
}

findCoverImageUrl(dom) {
return util.getFirstImgSrc(dom, "section.boxConteudo");
}

getInformationEpubItemChildNodes(dom) {
return [...dom.querySelectorAll("section.boxConteudo div.texto")];
}
}
1 change: 1 addition & 0 deletions plugin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ <h3>Instructions</h3>
<script src="js/parsers/SitesGoogleParser.js"></script>
<script src="js/parsers/SoverseParser.js"></script>
<script src="js/parsers/SpacebattlesParser.js"></script>
<script src="js/parsers/SpiritfanfictionParser.js"></script>
<script src="js/parsers/SspaiParser.js"></script>
<script src="js/parsers/StocxParser.js"></script>
<script src="js/parsers/SweekParser.js"></script>
Expand Down

0 comments on commit 829f9de

Please sign in to comment.