Greasy Fork is available in English.

مۇنازىرىلەر » ئىجادىيەت

Notify users of script updates

§
يوللانغان ۋاقتى: 2022-05-20

I am developing a script and I need to send a notification to those who have installed my script that I have uploaded a new version.
Does anyone know a way to do this?

§
يوللانغان ۋاقتى: 2022-05-21

fetch your greasyfork script link, then check for the version in the page against the script version, then if it is different open the greasyfork install page for your script.

q1k
§
يوللانغان ۋاقتى: 2022-05-21

I thought greasyfork doesn't like scripts that check themselves it there is an update and might even ban them?

§
يوللانغان ۋاقتى: 2022-05-21
تەھرىرلەنگەن ۋاقتى: 2022-05-21

@q1k

I read a while ago somewhere that it is okay as long as the check is not more frequent than once a day

§
يوللانغان ۋاقتى: 2022-05-24

https://greasyfork.org/en/help/code-rules

Scripts must not check for updates at a rate higher than once per day. Note that most user script managers will handle automatic updates, so doing it in the script is unnecessary. Scripts should also not dynamically inject another Greasy Fork-hosted script into a page, as this bypasses caching in user script managers.

§
يوللانغان ۋاقتى: 2022-06-14

fetch your greasyfork script link, then check for the version in the page against the script version, then if it is different open the greasyfork install page for your script.

Sorry for my ignorance, but how can I get the @version from the metadata of my script?

§
يوللانغان ۋاقتى: 2022-06-14
تەھرىرلەنگەن ۋاقتى: 2022-06-14
NotYouMod
§
يوللانغان ۋاقتى: 2022-07-16
تەھرىرلەنگەن ۋاقتى: 2022-07-16

@lpachecob you can use JS standard fetch or XHR to fetch script page, or you can use my library to fetch script page and get current version.

Guide how to get version using Greasy Fork API:

var GF = new GreasyFork // set upping api
var code = await GF.get().script().code(YOUR_SCRIPT_ID_HERE) // Get code
var version = g.parseScriptCodeMeta(code).filter(e => e.meta === '@version')[0].value // filtering array and getting value of @version

console.log(verion) // now you can do whatever you want with version

جاۋاب قايتۇرۇش

جاۋاب قايتۇرۇش ئۈچۈن كىرىش.