blob: 1bb700a61732c3b7cd657b8564b2e250daa9aa45 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
"use strict";
module.exports = Ferdi => {
const getMessages = function getMessages() {
// Initialize empty vars
var unread = 0;
var match = [];
// Extract the number from the title
match = document.title.match(/^\((\d+)\) Tiny Tiny RSS$/);
// Some logic to handle the match groups
unread = match != null && match.length > 0 ? match[1] : 0;
// Set unread msgs badge
Ferdi.setBadge(Number.parseInt(unread, 10));
};
const loopFunc = () => {
getMessages();
};
Ferdi.loop(loopFunc);
};
|