@require Another Auto Updater Instructions

Written by sizzlemctwizzle — Last update May 30, 2011

33 points

The Basics

The 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://sizzlemctwizzle.com/updater.php?id=your script id
That 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.

Extras

Some optional query values you can set:
  • days - obviously sets the number of days to wait between update checks.
    Example:
    • // @require http://sizzlemctwizzle.com/updater.php?id=script id&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.
    Example:
    • // @require http://sizzlemctwizzle.com/updater.php?id=script id&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
    The actual value is optional and scr_meta will be used by default.
    Example:
    • // @require http://sizzlemctwizzle.com/updater.php?id=script id&meta=name of metadata variable
    The disadvantage of using this method is that E4X is not compatible with other browsers and will prevent your script from running. I recommend against using this method for this reason.

  • 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.
    Example:
    • // @require http://sizzlemctwizzle.com/updater.php?id=script id&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.
    Example:
    • // @require http://sizzlemctwizzle.com/updater.php?id=script id&var=some string

Hosting

If you have your own server and don't want to be a freeloader the updater source is open and under public domain.

If you'd like to help me pay for hosting you can always donate via paypal.

Browser Compatibility

If 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 @require which causes them to request my server far too often. I can't handle that kind of traffic. Feel free to host my updater on your own server if you wish to support those user script extensions.

Mirrors

sizzlemctwizzle.com is hosting that I pay for and don't do much else with so it should take care of most people's needs. Please PM me if you want me to list your mirror.

Scripts using this updater

Here is a simple google search that gets all the scripts using this updater. Currently the number of results is 3,110.