-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(Feeder Series): add activity #10269
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
base: main
Are you sure you want to change the base?
Changes from all commits
e687eb5
1435739
e0b2e5a
a65e813
b0a6773
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$schema": "https://schemas.premid.app/metadata/1.16", | ||
| "apiVersion": 1, | ||
| "author": { | ||
| "id": "680080827450785798", | ||
| "name": "macekimek1" | ||
| }, | ||
| "service": "Feeder Series", | ||
| "description": { | ||
| "en": "Feeder Series started in 2019 with one simple mission: to bring you the best possible coverage of feeder series in Europe, the United States and Asia." | ||
| }, | ||
| "url": "feederseries.net", | ||
| "regExp": "^https?[:][/][/]([a-z0-9-]+[.])*feederseries[.]net[/]", | ||
| "version": "1.0.0", | ||
| "logo": "https://i.imgur.com/4dATceI.jpeg", | ||
| "thumbnail": "https://i.imgur.com/RyRzzyf.png", | ||
| "color": "#FEDC09", | ||
| "category": "other", | ||
| "tags": [ | ||
| "racing", | ||
| "formulaone" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| const presence = new Presence({ | ||
| clientId: '1452251315399819274' | ||
| }) | ||
|
|
||
| const browsingTimestamp = Math.floor(Date.now() / 1000) | ||
|
|
||
| enum ActivityAssets { | ||
| Logo = 'https://i.imgur.com/4dATceI.jpeg', | ||
| } | ||
|
|
||
| presence.on('UpdateData', () => { | ||
| const { pathname } = document.location | ||
|
|
||
| const presenceData: PresenceData = { | ||
| largeImageKey: ActivityAssets.Logo, | ||
| details: 'Browsing homepage', | ||
| startTimestamp: browsingTimestamp | ||
| } | ||
|
Comment on lines
+17
to
+18
Check failureCode scanning / ESLint Require or disallow trailing commas Error
Missing trailing comma.
|
||
|
|
||
| // Homepage | ||
| if (pathname === '/') { | ||
| presenceData.details = 'Browsing homepage' | ||
| } | ||
| // About page | ||
| else if (pathname.includes('/our-team')) { | ||
| presenceData.details = 'Reading about the team' | ||
| } | ||
| // How we work page | ||
| else if (pathname.includes('/how-we-work')) { | ||
| presenceData.details = 'Reading how the team works' | ||
| } | ||
| // Join us page | ||
| else if (pathname.includes('/join-us')) { | ||
| presenceData.details = 'Wanting to join the team' | ||
| } | ||
| // Support us page | ||
| else if (pathname.includes('/support-us')) { | ||
| presenceData.details = 'Wanting to support the team' | ||
| } | ||
| // Contact us page | ||
| else if (pathname.includes('/contact')) { | ||
| presenceData.details = 'Wanting to contact the team' | ||
| } | ||
| // Calendar page | ||
| else if (pathname.includes('/feeder-series-calendar')) { | ||
| presenceData.details = 'Looking at the feeder series calendar' | ||
| } | ||
| // Article pages | ||
| else if (pathname.includes('/2')) { | ||
| const articleTitle | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| = | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 6 spaces but found 4.
Check failureCode scanning / ESLint Enforce consistent linebreak style for operators Error
Bad line breaking before and after '='.
|
||
| document | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 8 spaces but found 6.
|
||
| .querySelector<HTMLHeadingElement>('h1.entry-title') | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.textContent | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.trim() | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
|
|
||
| presenceData.details = 'Reading an article' | ||
| presenceData.state = articleTitle ?? 'Article' | ||
| } | ||
| // Category pages | ||
| else if (pathname.includes('/category/')) { | ||
| const categoryName | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| = | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 6 spaces but found 4.
Check failureCode scanning / ESLint Enforce consistent linebreak style for operators Error
Bad line breaking before and after '='.
|
||
| document | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 8 spaces but found 6.
|
||
| .querySelector<HTMLSpanElement>('h1.page-title span') | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.textContent | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.trim() | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
|
|
||
| presenceData.details = 'Browsing a category' | ||
| presenceData.state = categoryName ?? 'Category' | ||
| } | ||
| // Tags pages | ||
| else if (pathname.includes('/tag/')) { | ||
| const tagName | ||
Check failureCode scanning / ESLint Disallow trailing whitespace at the end of lines Error
Trailing spaces not allowed.
|
||
| = | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 6 spaces but found 4.
Check failureCode scanning / ESLint Enforce consistent linebreak style for operators Error
Bad line breaking before and after '='.
|
||
| document | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 8 spaces but found 6.
|
||
| .querySelector<HTMLSpanElement>('h1.page-title span') | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.textContent | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
| ?.trim() | ||
Check failureCode scanning / ESLint Enforce consistent indentation Error
Expected indentation of 10 spaces but found 8.
|
||
|
|
||
| presenceData.details = 'Browsing a tag' | ||
| presenceData.state = tagName ?? 'Tag' | ||
| } | ||
|
|
||
| presence.setActivity(presenceData) | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "extends": "../../../tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "outDir": "./dist/" | ||
| } | ||
| } |
Check failure
Code scanning / ESLint
Require or disallow trailing commas Error