Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions websites/M/Moodle UTC/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://schemas.premid.app/metadata/1.16",
"apiVersion": 1,
"author": {
"id": "357901042895028226",
"name": "revaliiuwu"
},
"service": "Moodle UTC",
"description": {
"en": "Affiche l'activité sur le Moodle de l'UTC"
},
"url": "moodle.utc.fr",

Check failure

Code scanning / PMD

Validates that activity URLs have valid DNS records Error

DNS check failed for URL "moodle.utc.fr": Domain exists but has no A or AAAA records
"regExp": "moodle\\.utc\\.fr",
"version": "1.0.0",
"logo": "https://i.imgur.com/oMApXis.png",

Check failure

Code scanning / PMD

Makes sure all images (logo and URLs) are exactly 512x512 pixels Error

Image URL dimensions must be exactly 512x512 pixels, got 802x791 for URL: https://i.imgur.com/oMApXis.png
"thumbnail": "https://i.imgur.com/45X0M1t.jpeg",
"color": "#ffcc00",
"category": "other",
"tags": [
"utc",
"education"
]
}

32 changes: 32 additions & 0 deletions websites/M/Moodle UTC/presence.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ActivityType } from 'premid'

const presence = new Presence({
clientId: '1459651066508345394'
})
Comment on lines +4 to +5

Check failure

Code scanning / ESLint

Require or disallow trailing commas Error

Missing trailing comma.

const startTimestamp = Math.floor(Date.now() / 1000)

presence.on('UpdateData', async () => {
const presenceData: PresenceData = {
type: ActivityType.Watching,
largeImageKey: 'https://i.imgur.com/oMApXis.png',

Check failure

Code scanning / PMD

Makes sure all images (logo and URLs) are exactly 512x512 pixels Error

Image URL dimensions must be exactly 512x512 pixels, got 802x791 for URL: https://i.imgur.com/oMApXis.png
largeImageText: 'Moodle UTC',
startTimestamp
}
Comment on lines +14 to +15

Check failure

Code scanning / ESLint

Require or disallow trailing commas Error

Missing trailing comma.

const path = document.location.pathname;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.

if (path.includes('/course/view.php')) {
const courseTitle = document.querySelector('h1')?.textContent || 'Un cours';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.details = courseTitle;

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.state = 'En train d\'étudier';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else if (path === '/' || path.includes('/my/')) {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.details = 'Sur l\'accueil';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.state = 'Choisit son prochain cours';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
} else {

Check failure

Code scanning / ESLint

Enforce consistent brace style for blocks Error

Closing curly brace appears on the same line as the subsequent block.
presenceData.details = 'Navigue sur Moodle';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
presenceData.state = 'UTC - Compiègne';

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
}

presence.setActivity(presenceData);

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
});

Check failure

Code scanning / ESLint

Require or disallow semicolons instead of ASI Error

Extra semicolon.
Loading