Skip to content

Commit

Permalink
chore: lint P folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas950 committed Jan 21, 2025
1 parent 01f943c commit ed9f10b
Show file tree
Hide file tree
Showing 136 changed files with 11,739 additions and 11,083 deletions.
54 changes: 27 additions & 27 deletions websites/P/PCGamingWiki/metadata.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"id": "354233941550694400",
"name": "kuriel."
},
"service": "PCGamingWiki",
"description": {
"en": "PCGamingWiki aims to list fixes and workarounds for every single PC game. "
},
"url": [
"www.pcgamingwiki.com",
"pcgamingwiki.com",
"community.pcgamingwiki.com"
],
"version": "1.0.1",
"logo": "https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/logo.jpeg",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/thumbnail.png",
"color": "#556db3",
"category": "other",
"tags": [
"wiki",
"information",
"pc",
"gaming"
]
}
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"id": "354233941550694400",
"name": "kuriel."
},
"service": "PCGamingWiki",
"description": {
"en": "PCGamingWiki aims to list fixes and workarounds for every single PC game. "
},
"url": [
"www.pcgamingwiki.com",
"pcgamingwiki.com",
"community.pcgamingwiki.com"
],
"version": "1.0.1",
"logo": "https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/logo.jpeg",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/thumbnail.png",
"color": "#556db3",
"category": "other",
"tags": [
"wiki",
"information",
"pc",
"gaming"
]
}
282 changes: 146 additions & 136 deletions websites/P/PCGamingWiki/presence.ts
Original file line number Diff line number Diff line change
@@ -1,143 +1,153 @@
const presence = new Presence({
clientId: "1325499066565656647",
}),
browsingTimestamp = Math.floor(Date.now() / 1000);
clientId: '1325499066565656647',
})
const browsingTimestamp = Math.floor(Date.now() / 1000)

const enum Assets {
Logo = "https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/0.png",
Logo = 'https://cdn.rcd.gg/PreMiD/websites/P/PCGamingWiki/assets/0.png',
}

presence.on("UpdateData", async () => {
const { pathname, search, href, hostname } = document.location,
presenceData: PresenceData = {
largeImageKey: Assets.Logo,
startTimestamp: browsingTimestamp,
details: "Viewing Page:",
};
presence.on('UpdateData', async () => {
const { pathname, search, href, hostname } = document.location
const presenceData: PresenceData = {
largeImageKey: Assets.Logo,
startTimestamp: browsingTimestamp,
details: 'Viewing Page:',
}

switch (hostname) {
case "community.pcgamingwiki.com": {
switch (pathname.split("/")[1]) {
case "topic": {
presenceData.details = "On Topic:";
presenceData.state = document.querySelector(
"span.ipsType_break > span:nth-child(1)"
);
presenceData.buttons = [{ label: "View Topic", url: href }];
break;
}
case "forum": {
presenceData.details = "On Forum:";
presenceData.state = document.querySelector(".ipsType_pageTitle");
presenceData.buttons = [{ label: "View Forum", url: href }];
break;
}
case "profile": {
presenceData.details = "Viewing Profile:";
presenceData.state = document.querySelector("h1.ipsType_reset");
break;
}
case "staff": {
presenceData.details = "On Staff page";
break;
}
case "leaderboard":
case "pastleaders":
case "topmembers": {
presenceData.details = "On Leaderboard page";
break;
}
case "gallery": {
if (pathname.split("/")[2] === "image") {
presenceData.details = "Viewing Image:";
presenceData.state = document.querySelector("span.ipsContained");
presenceData.buttons = [{ label: "View Image", url: href }];
} else presenceData.details = "On Gallery page";
break;
}
case "online": {
presenceData.details = "Viewing Online Users";
break;
}
case "files": {
if (pathname.split("/")[2] === "file") {
presenceData.details = "Viewing File:";
presenceData.state = document.querySelector(
"h1.ipsType_pageTitle > span:nth-child(1)"
);
presenceData.buttons = [{ label: "View File", url: href }];
} else presenceData.details = "Viewing Files page";
break;
}
case "tags": {
presenceData.details = "Searching for tag:";
presenceData.state = decodeURIComponent(pathname.split("/")[2]);
break;
}
case "search": {
presenceData.details = "On Search Page";
if (search.split("=")[1]) {
presenceData.details = "Searching the Community for:";
presenceData.state = decodeURIComponent(
search.split("=")[1]
).replace("&search_and_or", "");
}
break;
}
case "discover": {
presenceData.details = "Viewing All Activity";
break;
}
default: {
presenceData.details = "Exploring Community";
break;
}
}
break;
}
default: {
switch (pathname.split("/")[2]) {
case "Home": {
presenceData.details = "In Home";
break;
}
case "PCGamingWiki:About": {
presenceData.state = "About Us";
break;
}
case "index.php": {
if (decodeURIComponent(search.split("=")[2]) === "edit") {
presenceData.details = "Viewing Source of:";
presenceData.state = document
.querySelector(".article-title")
?.textContent?.trim()
.replace("View source for ", "");
}
if (decodeURIComponent(search.split("=")[2]) === "history") {
presenceData.details = "Viewing revision history of:";
presenceData.state = document
.querySelector(".article-title")
?.textContent?.trim()
.replace("Revision history of ", "")
.slice(1, -1);
} else {
presenceData.details = "Searching for:";
presenceData.state = decodeURIComponent(
search.split("=")[1]
).replace("&title", "");
}
break;
}
default: {
presenceData.state = document
.querySelector(".article-title")
?.textContent?.trim();
break;
}
}
break;
}
}
switch (hostname) {
case 'community.pcgamingwiki.com': {
switch (pathname.split('/')[1]) {
case 'topic': {
presenceData.details = 'On Topic:'
presenceData.state = document.querySelector(
'span.ipsType_break > span:nth-child(1)',
)
presenceData.buttons = [{ label: 'View Topic', url: href }]
break
}
case 'forum': {
presenceData.details = 'On Forum:'
presenceData.state = document.querySelector('.ipsType_pageTitle')
presenceData.buttons = [{ label: 'View Forum', url: href }]
break
}
case 'profile': {
presenceData.details = 'Viewing Profile:'
presenceData.state = document.querySelector('h1.ipsType_reset')
break
}
case 'staff': {
presenceData.details = 'On Staff page'
break
}
case 'leaderboard':
case 'pastleaders':
case 'topmembers': {
presenceData.details = 'On Leaderboard page'
break
}
case 'gallery': {
if (pathname.split('/')[2] === 'image') {
presenceData.details = 'Viewing Image:'
presenceData.state = document.querySelector('span.ipsContained')
presenceData.buttons = [{ label: 'View Image', url: href }]
}
else {
presenceData.details = 'On Gallery page'
}
break
}
case 'online': {
presenceData.details = 'Viewing Online Users'
break
}
case 'files': {
if (pathname.split('/')[2] === 'file') {
presenceData.details = 'Viewing File:'
presenceData.state = document.querySelector(
'h1.ipsType_pageTitle > span:nth-child(1)',
)
presenceData.buttons = [{ label: 'View File', url: href }]
}
else {
presenceData.details = 'Viewing Files page'
}
break
}
case 'tags': {
presenceData.details = 'Searching for tag:'
presenceData.state = decodeURIComponent(pathname.split('/')[2])
break
}
case 'search': {
presenceData.details = 'On Search Page'
if (search.split('=')[1]) {
presenceData.details = 'Searching the Community for:'
presenceData.state = decodeURIComponent(
search.split('=')[1],
).replace('&search_and_or', '')
}
break
}
case 'discover': {
presenceData.details = 'Viewing All Activity'
break
}
default: {
presenceData.details = 'Exploring Community'
break
}
}
break
}
default: {
switch (pathname.split('/')[2]) {
case 'Home': {
presenceData.details = 'In Home'
break
}
case 'PCGamingWiki:About': {
presenceData.state = 'About Us'
break
}
case 'index.php': {
if (decodeURIComponent(search.split('=')[2]) === 'edit') {
presenceData.details = 'Viewing Source of:'
presenceData.state = document
.querySelector('.article-title')
?.textContent
?.trim()
.replace('View source for ', '')
}
if (decodeURIComponent(search.split('=')[2]) === 'history') {
presenceData.details = 'Viewing revision history of:'
presenceData.state = document
.querySelector('.article-title')
?.textContent
?.trim()
.replace('Revision history of ', '')
.slice(1, -1)
}
else {
presenceData.details = 'Searching for:'
presenceData.state = decodeURIComponent(
search.split('=')[1],
).replace('&title', '')
}
break
}
default: {
presenceData.state = document
.querySelector('.article-title')
?.textContent
?.trim()
break
}
}
break
}
}

presence.setActivity(presenceData);
});
presence.setActivity(presenceData)
})
46 changes: 23 additions & 23 deletions websites/P/PERPHeads/metadata.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Jackelele",
"id": "377175513372033024"
},
"service": "PERPHeads",
"description": {
"en": "An awesome Garry's Mod community",
"nl": "Een geweldige Garry's Mod-community"
},
"url": "perpheads.com",
"regExp": "([a-z0-9-]+[.])*perpheads[.]com[/]",
"version": "1.0.18",
"logo": "https://cdn.rcd.gg/PreMiD/websites/P/PERPHeads/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/P/PERPHeads/assets/thumbnail.png",
"color": "#FFA500",
"category": "games",
"tags": [
"garrysmod",
"perpheads"
]
}
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Jackelele",
"id": "377175513372033024"
},
"service": "PERPHeads",
"description": {
"en": "An awesome Garry's Mod community",
"nl": "Een geweldige Garry's Mod-community"
},
"url": "perpheads.com",
"regExp": "([a-z0-9-]+[.])*perpheads[.]com[/]",
"version": "1.0.18",
"logo": "https://cdn.rcd.gg/PreMiD/websites/P/PERPHeads/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/P/PERPHeads/assets/thumbnail.png",
"color": "#FFA500",
"category": "games",
"tags": [
"garrysmod",
"perpheads"
]
}
Loading

0 comments on commit ed9f10b

Please sign in to comment.