Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Teckie): add Teckie support #9280

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
24 changes: 24 additions & 0 deletions websites/T/Teckie/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://schemas.premid.app/metadata/1.13",
"apiVersion": 1,
"author": {
"id": "343103632453009408",
"name": "bakzkndd"
},
"service": "Teckie",
"description": {
"en": "A Dutch computer repair, support and sales company",
"nl": "Een Nederlands computer repareer, support en verkoop bedrijf"
},
"url": "teckie.nl",
"version": "1.0.0",
"logo": "https://i.postimg.cc/FHdK56R2/my-ONfuy-waifu2x-art-noise1-scale-waifu2x-art-noise1-scale-waifu2x-art-noise1-scale.png",
"thumbnail": "https://i.imgur.com/6jejHTw.png",
"color": "#a859f8",
"category": "other",
"tags": [
"pc",
"store",
"shopping"
]
}
39 changes: 39 additions & 0 deletions websites/T/Teckie/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const presence = new Presence({
clientId: '576477712470769675',
})

enum ActivityAssets { // Other default assets can be found at index.d.ts
Logo = 'https://i.postimg.cc/FHdK56R2/my-ONfuy-waifu2x-art-noise1-scale-waifu2x-art-noise1-scale-waifu2x-art-noise1-scale.png',
}

presence.on('UpdateData', async () => {
const presenceData: PresenceData = {
largeImageKey: ActivityAssets.Logo,
details: 'Bezoekt Teckie',
}

switch (document.location.pathname.split('/')[1]) {
case 'pages': {
presenceData.details = 'Bekijkt een pagina'
presenceData.state = `Pagina: ${document.title.split('– Teckie')?.[0]}`
break
}
case 'products': {
presenceData.details = 'Bekijkt een product'
presenceData.state = document.querySelector('.product__title')?.textContent?.trim()?.replace("\n ", "") ?? ""
break
}
case 'policies': {
presenceData.details = 'Bekijkt een policy'
presenceData.state = document.querySelector('.shopify-policy__title')?.textContent ?? ""
break
}
case 'blogs': {
presenceData.details = `Bekijkt een ${document.location.pathname.split('/')[2]} blog`
presenceData.state = document.querySelector('[itemprop="headline"]')?.textContent.replace(/\n /gm, "") ?? ""
break
}
}

presence.setActivity(presenceData)
})
Loading