Skip to content

Instantly share code, notes, and snippets.

@Lapin0t
Created August 18, 2021 13:04
Show Gist options
  • Save Lapin0t/9849013d1efaf5fc3f615b58d7b26366 to your computer and use it in GitHub Desktop.
Save Lapin0t/9849013d1efaf5fc3f615b58d7b26366 to your computer and use it in GitHub Desktop.
v0000
// ==UserScript==
// @name New script - youtube.com
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/
// @grant GM_notification
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @version 1.0
// @author -
// @description 8/18/2021, 1:19:18 PM
// ==/UserScript==
const INTERVAL_SEC = 30 * 60
const TACHES = [
"tache 1",
"tache 2",
]
const time_now = () => {
var d = new Date()
return (d.getTime() / 1000)|0
}
now = time_now()
console.log(now)
const last = GM_getValue("last-ping", -INTERVAL_SEC)
if (now - last >= INTERVAL_SEC) {
GM_setValue("last-ping", now)
GM_notification({ text: TACHES[0], title: "🚰 TODO", image: "bad"})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment