Skip to content

Commit

Permalink
Merge pull request #427 from sunx2/master
Browse files Browse the repository at this point in the history
 added Just Light Novels
  • Loading branch information
Bas950 committed Oct 13, 2019
2 parents b133dd9 + 3cef090 commit c575d99
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Edge Me Please/dist/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"service": "Edge Me Please",
"description": {
"en": ":D Happy Edging your little dicklet."
"en": "It's a edging instruction website if you are into it."
},
"url": "www.edgemeplease.com",
"version": "1.1",
Expand Down
21 changes: 21 additions & 0 deletions Just Light Novels/dist/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"author": {
"name": "Nekolen",
"id": "270125856679002113"
},
"service": "Just Light Novels",
"description": {
"en": "Just Light Novels! Home of All Light Novels"
},
"url": "justlightnovels.com",
"version": "1.0",
"logo": "https://cdn.discordapp.com/attachments/270798717089480704/631596622090076161/unknown.png",
"thumbnail": "https://cdn.discordapp.com/attachments/270798717089480704/631592561995415562/unknown.png",
"color":"#0000ff",
"tags": [
"light novels",
"reading",
"free"
],
"category": "other"
}
92 changes: 92 additions & 0 deletions Just Light Novels/dist/presence.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
let presence = new Presence({
clientId: "631595418085490689"
});
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
}


presence.on("UpdateData", () => __awaiter(this, void 0, void 0, function* () {
if (document.location.pathname == "/") {
elapsed = Math.floor(Date.now() / 1000)
let presenceData = {
details: "Browsing novels",
state: "at Homepage",
//largeImageKey: "banner",
largeImageKey: "logo",
startTimestamp:elapsed

};

presence.setActivity(presenceData);
}

else if(document.location.pathname=="//"){
var stext = document.location.search.split("=")
elapsed = Math.floor(Date.now() / 1000)
let presenceData = {
details: "Searching novels",
state: `Keyword: ${stext[1].split("+").join(" ").capitalize()}`,
//largeImageKey: "banner",
largeImageKey: "logo",
startTimestamp:elapsed

};

presence.setActivity(presenceData);
}

else if(document.location.pathname.startsWith("/category/")){
var stext = document.location.pathname.split("/")
elapsed = Math.floor(Date.now() / 1000)
let presenceData = {
details: `Searching novels `,
state: `${stext[1].capitalize()}: ${stext[2].split("-").join(" ").capitalize()}`,
//largeImageKey: "banner",
largeImageKey: "logo",
startTimestamp:elapsed

};

presence.setActivity(presenceData);
}

else if(["/reviews/","/ln-fest-series/"].includes(document.location.pathname)){
elapsed = Math.floor(Date.now() / 1000)
let presenceData = {
details: `Browsing site`,
state: `looking at ${document.location.pathname.split("/").join("").split("-").join(" ").capitalize()}`,
//largeImageKey: "banner",
largeImageKey: "logo",
startTimestamp:elapsed

};

presence.setActivity(presenceData);
}

else {
var d = document.location.pathname.split("/")
if(d.length!=5){}
else{
elapsed = Math.floor(Date.now() / 1000)
let presenceData = {
details: `Reading ${d[3].split("-").join(" ").capitalize()}(${d[1]})`,
state: `Looking at ${(document.location.hash.length==0)?"Novel":document.location.hash.replace("#",'').capitalize()}`,
//largeImageKey: "banner",
largeImageKey: "logo",
startTimestamp:elapsed

};

presence.setActivity(presenceData);
}


}





}));

0 comments on commit c575d99

Please sign in to comment.