The BasicsThe number one goal of my @require updater is to keep things super simple and not much explanation is needed, but here are the basics. To @require my script place this in the header of your script:
// @require http://update.sizzlemctwizzle.com/your script id.jsThat is all you need to make sure your users get notified when there is an update available. If @version isn't present in your metadata, the version number Userscripts.org assigns your script automatically every time you upload a new version will be used for update checking.
ExtrasSome optional query values you can set:
days- obviously sets the number of days to wait between update checks.
// @require http://update.sizzlemctwizzle.com/your script id.js?days=7
uso- a flag that forces the Userscripts.org version number to be used for update checking even when an @version value is present in your metadata.
// @require http://update.sizzlemctwizzle.com/your script id.js?uso
meta- set this flag to a variable used to store wrapped metadata. Users of my old updater will be familiar with this method. It allows my updater to use the metadata present in your script rather than the metadata obtained from Userscripts.org at the time of install. You wrap your own script metadata using E4X like this:
var scr_meta=<><![CDATA[ // Make sure to copy this line right above the script metadata // ==UserScript== // @name Another Auto Update Script // @namespace sizzlemctwizzle // @description Include the code in your user scripts so they check for updates automatically // @version 1.1.7 // @include * // ==/UserScript== ]]></>.toString(); // Make sure to copy this line right below
// @require http://update.sizzlemctwizzle.com/your script id.js?meta=name of metadata variable
show- a flag that sends a user to the script's description page when they are notified of an update to the script. The default behavior is a prompt to install the latest version.
// @require http://update.sizzlemctwizzle.com/your script id.js?show
var- by default this value is set to your script id. It is used to provide a unique name for the variable name of your updater object and the name used to save the date of the last update check.
// @require http://update.sizzlemctwizzle.com/your script id.js?var=some string
HostingSince sizzlemctwizzle.com runs on an old Pentium 4 in my basement (lighttpd + FastCGI + PHP5), you may want to host the updater yourself. The updater source is open and under public domain. If you're using lighttpd and want my rewrite rules, just ask.
Browser CompatibilityIf you install a script with my updater in Google Chrome or GreaseKit, it should be ignored and not cause any errors. If you install my updater in either NinjaKit or Tampermonkey I can't assure you that it won't break your script. Both extensions have been banned from using my updater because they improperly implement
@requirewhich causes too much traffic.