Skip to content

Commit

Permalink
chore: format C folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas950 committed Jan 19, 2025
1 parent b9716d8 commit 4e405ef
Show file tree
Hide file tree
Showing 132 changed files with 12,377 additions and 11,594 deletions.
78 changes: 39 additions & 39 deletions websites/C/CDKeys/metadata.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Dark_Ville",
"id": "638080361179512853"
},
"service": "CDKeys",
"description": {
"nl": "Hier bij CDKeys.com zijn we gespecialiseerd in het verstrekken van de beste digitale codes voor de populairste games. Je hoeft niet meer de volle prijs te betalen of te wachten op een spel. Wij combineren de laagste prijzen met een snelle digitale levering, zodat je snel kunt beginnen met het spelen van je favoriete games.",
"en": "Here at CDKeys.com, we specialise in providing you with the best digital codes for the hottest games. There’s no need to pay full price or wait for a game again. We combine the lowest prices with rapid digital delivery, so you can start playing your favourite games, fast."
},
"url": "www.cdkeys.com",
"version": "1.1.9",
"logo": "https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/thumbnail.png",
"color": "#1F143D",
"category": "other",
"tags": [
"cdkeys",
"games",
"key",
"buy",
"game-key"
],
"settings": [
{
"id": "buttons",
"title": "Show Buttons",
"icon": "fas fa-compress-arrows-alt",
"value": true
},
{
"id": "cover",
"title": "Show Cover",
"icon": "fad fa-album",
"value": true
}
]
}
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Dark_Ville",
"id": "638080361179512853"
},
"service": "CDKeys",
"description": {
"nl": "Hier bij CDKeys.com zijn we gespecialiseerd in het verstrekken van de beste digitale codes voor de populairste games. Je hoeft niet meer de volle prijs te betalen of te wachten op een spel. Wij combineren de laagste prijzen met een snelle digitale levering, zodat je snel kunt beginnen met het spelen van je favoriete games.",
"en": "Here at CDKeys.com, we specialise in providing you with the best digital codes for the hottest games. There’s no need to pay full price or wait for a game again. We combine the lowest prices with rapid digital delivery, so you can start playing your favourite games, fast."
},
"url": "www.cdkeys.com",
"version": "1.1.9",
"logo": "https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/thumbnail.png",
"color": "#1F143D",
"category": "other",
"tags": [
"cdkeys",
"games",
"key",
"buy",
"game-key"
],
"settings": [
{
"id": "buttons",
"title": "Show Buttons",
"icon": "fas fa-compress-arrows-alt",
"value": true
},
{
"id": "cover",
"title": "Show Cover",
"icon": "fad fa-album",
"value": true
}
]
}
186 changes: 98 additions & 88 deletions websites/C/CDKeys/presence.ts
Original file line number Diff line number Diff line change
@@ -1,91 +1,101 @@
const presence = new Presence({
clientId: "940892975502856232",
}),
browsingTimestamp = Math.floor(Date.now() / 1000);
clientId: '940892975502856232',
})
const browsingTimestamp = Math.floor(Date.now() / 1000)

presence.on("UpdateData", async () => {
const presenceData: PresenceData = {
largeImageKey:
"https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png",
startTimestamp: browsingTimestamp,
},
{ pathname, href } = document.location,
[buttons, covers] = await Promise.all([
presence.getSetting<boolean>("buttons"),
presence.getSetting<boolean>("cover"),
]),
search = document.querySelector<HTMLInputElement>('[id="search"]'),
active = document.querySelector('[class="navigation__link current"]'),
series = document.querySelector(
"#maincontent > div.columns > div > div.wrap.cms-content"
),
game = document.querySelector(
"#maincontent > div.pathname-title-wrapper > h1 > span"
);
if (search?.value) {
presenceData.details = "Searching for";
presenceData.state = search.value;
presenceData.smallImageKey = Assets.Search;
} else if (game) {
presenceData.buttons = [
{
label: "View Game",
url: href,
},
];
presenceData.largeImageKey =
document
.querySelector<HTMLImageElement>('[alt="main product photo"]')
?.getAttribute("src") ?? "logo";
presenceData.details = "Viewing product";
presenceData.state = game.textContent;
} else if (document.querySelector("#product-addtocart-button")) {
presenceData.largeImageKey =
document
.querySelector<HTMLImageElement>('[alt="main product photo"]')
?.getAttribute("src") ?? "logo";
presenceData.buttons = [
{
label: "View Product",
url: href,
},
];
presenceData.details = "Viewing product";
presenceData.state = document.querySelector<HTMLMetaElement>(
"meta[property='og:title']"
).content;
} else if (series) {
presenceData.buttons = [
{
label: "View Product Series",
url: href,
},
];
presenceData.details = "Viewing product series";
presenceData.state = series.querySelector('[alt*=" "]').getAttribute("alt");
} else if (active || pathname.includes("/coming-soon")) {
presenceData.buttons = [
{
label: "View Category",
url: href,
},
];
presenceData.details = "Viewing Category:";
presenceData.state = active?.textContent ?? "Coming soon";
} else if (pathname.includes("-sale")) {
presenceData.details =
document.querySelector<HTMLMetaElement>('[name="title"]').content;
} else if (pathname.includes("order/history"))
presenceData.details = "Order History";
else if (pathname.includes("/cart")) presenceData.details = "Cart";
else if (pathname === "/") presenceData.details = "Home page";
else if (pathname.includes("/wishlist")) presenceData.details = "Wishlist";
presence.on('UpdateData', async () => {
const presenceData: PresenceData = {
largeImageKey: 'https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png',
startTimestamp: browsingTimestamp,
}
const { pathname, href } = document.location
const [buttons, covers] = await Promise.all([
presence.getSetting<boolean>('buttons'),
presence.getSetting<boolean>('cover'),
])
const search = document.querySelector<HTMLInputElement>('[id="search"]')
const active = document.querySelector('[class="navigation__link current"]')
const series = document.querySelector(
'#maincontent > div.columns > div > div.wrap.cms-content',
)
const game = document.querySelector(
'#maincontent > div.pathname-title-wrapper > h1 > span',
)
if (search?.value) {
presenceData.details = 'Searching for'
presenceData.state = search.value
presenceData.smallImageKey = Assets.Search
}
else if (game) {
presenceData.buttons = [
{
label: 'View Game',
url: href,
},
]
presenceData.largeImageKey = document
.querySelector<HTMLImageElement>('[alt="main product photo"]')
?.getAttribute('src') ?? 'logo'
presenceData.details = 'Viewing product'
presenceData.state = game.textContent
}
else if (document.querySelector('#product-addtocart-button')) {
presenceData.largeImageKey = document
.querySelector<HTMLImageElement>('[alt="main product photo"]')
?.getAttribute('src') ?? 'logo'
presenceData.buttons = [
{
label: 'View Product',
url: href,
},
]
presenceData.details = 'Viewing product'
presenceData.state = document.querySelector<HTMLMetaElement>(
'meta[property=\'og:title\']',
)?.content
}
else if (series) {
presenceData.buttons = [
{
label: 'View Product Series',
url: href,
},
]
presenceData.details = 'Viewing product series'
presenceData.state = series.querySelector('[alt*=" "]')?.getAttribute('alt')
}
else if (active || pathname.includes('/coming-soon')) {
presenceData.buttons = [
{
label: 'View Category',
url: href,
},
]
presenceData.details = 'Viewing Category:'
presenceData.state = active?.textContent ?? 'Coming soon'
}
else if (pathname.includes('-sale')) {
presenceData.details = document.querySelector<HTMLMetaElement>('[name="title"]')?.content
}
else if (pathname.includes('order/history')) {
presenceData.details = 'Order History'
}
else if (pathname.includes('/cart')) {
presenceData.details = 'Cart'
}
else if (pathname === '/') {
presenceData.details = 'Home page'
}
else if (pathname.includes('/wishlist')) {
presenceData.details = 'Wishlist'
}

if (!buttons) delete presenceData.buttons;
if (!covers) {
presenceData.largeImageKey =
"https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png";
}
if (presenceData.details) presence.setActivity(presenceData);
else presence.setActivity();
});
if (!buttons)
delete presenceData.buttons
if (!covers) {
presenceData.largeImageKey = 'https://cdn.rcd.gg/PreMiD/websites/C/CDKeys/assets/logo.png'
}
if (presenceData.details)
presence.setActivity(presenceData)
else presence.setActivity()
})
48 changes: 24 additions & 24 deletions websites/C/CHIP Online/metadata.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Eren",
"id": "478937019758673931"
},
"service": "CHIP Online",
"description": {
"tr": "Teknoloji/spor/gündem ve insanların blog oluşturduğu, Türkiye'de popüler bir site.",
"en": "CHIP Online is the independent web portal of the CHIP brand.",
"nl": "CHIP Online is het onafhankelijke webportaal van het merk CHIP.",
"vi_VN": "CHIP Online là cổng trang web độc lập của thương hiệu CHIP."
},
"url": "www.chip.com.tr",
"version": "1.4.23",
"logo": "https://cdn.rcd.gg/PreMiD/websites/C/CHIP%20Online/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/C/CHIP%20Online/assets/thumbnail.png",
"color": "#F10C0C",
"category": "other",
"tags": [
"news",
"turkish"
]
}
"$schema": "https://schemas.premid.app/metadata/1.12",
"apiVersion": 1,
"author": {
"name": "Eren",
"id": "478937019758673931"
},
"service": "CHIP Online",
"description": {
"tr": "Teknoloji/spor/gündem ve insanların blog oluşturduğu, Türkiye'de popüler bir site.",
"en": "CHIP Online is the independent web portal of the CHIP brand.",
"nl": "CHIP Online is het onafhankelijke webportaal van het merk CHIP.",
"vi_VN": "CHIP Online là cổng trang web độc lập của thương hiệu CHIP."
},
"url": "www.chip.com.tr",
"version": "1.4.23",
"logo": "https://cdn.rcd.gg/PreMiD/websites/C/CHIP%20Online/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/C/CHIP%20Online/assets/thumbnail.png",
"color": "#F10C0C",
"category": "other",
"tags": [
"news",
"turkish"
]
}
Loading

0 comments on commit 4e405ef

Please sign in to comment.