<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussion on Script Update Checker | Userscripts.org</title>
    <link>http://userscripts.org/scripts/show/20145</link>
    <description>Recent comments on userscript: Script Update Checker</description>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>How to get the @version ?, replied by Jarett</title>
      <description>&lt;p&gt;Ah, thanks. I figured there was a way to get the local metadata; I just didn't know what it was.&lt;/p&gt;</description>
      <pubDate>Sun, 04 Oct 2009 02:08:40 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:175910</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/175910</link>
    </item>
    <item>
      <title>@require usage, replied by ViXaY Xavier</title>
      <description>&lt;p&gt;Currently your script can't be used via @require. Is there a way that you can add that functionality?&lt;/p&gt;

&lt;p&gt;basically fetch the ScriptNum from the script that it's being included in? Maybe something using the metadata block comment i made earlier?&lt;/p&gt;

&lt;p&gt;another nicer feature would be to use a div instead of an alert, so that the script can continue to function even after an update. 
&lt;br /&gt;just some thoughts.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Oct 2009 10:04:58 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:36432:175430</guid>
      <author>ViXaY Xavier</author>
      <link>http://userscripts.org/posts/175430</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by ViXaY Xavier</title>
      <description>&lt;p&gt;also check out the metadata block info on &lt;a href=&quot;http://wiki.greasespot.net/Metadata_block&quot;&gt;http://wiki.greasespot.net/Metadata_block&lt;/a&gt;. This has a very good example on parsing metadata for local and remote scripts! :)
&lt;br /&gt;I found a problem though when parsing remote meta data I had to make a minor modification.
&lt;br /&gt;from
&lt;br /&gt;&lt;pre&gt;
  for each (line in lines) {
&lt;/pre&gt;
&lt;br /&gt;to
&lt;br /&gt;&lt;pre&gt;
  var i=0;
  for each (line in lines) {
    if (++i &gt; lines.length) break; // to control error in looping from remote responses
&lt;/pre&gt;
&lt;br /&gt;because the loop was continuing even after reaching the last element... don't know why.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Oct 2009 10:00:41 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:175428</guid>
      <author>ViXaY Xavier</author>
      <link>http://userscripts.org/posts/175428</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Jarett</title>
      <description>&lt;p&gt;No problem.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Sep 2009 03:43:57 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:165441</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/165441</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Arias</title>
      <description>&lt;p&gt;yes, that was something i was looking for.
&lt;br /&gt;I will try it ! thanks for your time and help !&lt;/p&gt;</description>
      <pubDate>Wed, 02 Sep 2009 22:32:47 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:165380</guid>
      <author>Arias</author>
      <link>http://userscripts.org/posts/165380</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Jarett</title>
      <description>&lt;p&gt;You'd have to parse it out of the meta.js file for that script. Probably something like this (I haven't tested this, so there might be some syntax errors):&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
var script_number=56716;

try
{
	GM_xmlhttpRequest(
	{
		method: 'GET',
		url: 'http://userscripts.org/scripts/source/'+ script_number +'.meta.js?'+new Date().getTime(),
		headers: {'Cache-Control': 'no-cache'},
		onload: function(resp)
		{
			var remote_version;
			
			remote_version=parseInt(/@version\s*(.*?)\s*$/m.exec(resp.responseText)[1]);
			alert('Remote version is: '+ remote_version);
		}
	});
}
catch (err)
{
	alert('An error occurred while checking the version:\n'+ err);
}
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 02 Sep 2009 01:57:13 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:165123</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/165123</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Arias</title>
      <description>&lt;p&gt;hm, how to creating a var from the version on the site.&lt;/p&gt;

&lt;p&gt;for example if you take my script &lt;a href=&quot;http://userscripts.org/scripts/show/56716&quot;&gt;http://userscripts.org/scripts/show/56716&lt;/a&gt;, in the code i got the meta-data &quot;@version&quot;.&lt;/p&gt;

&lt;p&gt;var localver = &quot;1.2.4.1.1&quot;; //this value can I change manually every time I update the script
&lt;br /&gt;var remotever = ? //this value should be the value you can find on the script page, in the upper left corner &quot;Version:  1.2.4.1.1&quot; (it's from the metadata @version in the latest code).&lt;/p&gt;

&lt;p&gt;so i can get this to work I can just be using a message when a new version is out, like;
&lt;br /&gt;(&quot;I new version is out: &quot;+remotever+&quot;. Your current version is: &quot;+localver+&quot;. Wanna download new one?&quot;);&lt;/p&gt;

&lt;p&gt;My english is not the best, hope you get what I meant.&lt;/p&gt;</description>
      <pubDate>Tue, 01 Sep 2009 23:59:44 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:165085</guid>
      <author>Arias</author>
      <link>http://userscripts.org/posts/165085</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Jarett</title>
      <description>&lt;p&gt;I'm not sure what you're asking.&lt;/p&gt;</description>
      <pubDate>Tue, 01 Sep 2009 23:20:05 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:165078</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/165078</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Arias</title>
      <description>&lt;p&gt;the local version can you just add a variable manually. dont you know about getting the remote &quot;real&quot; version number ?&lt;/p&gt;</description>
      <pubDate>Tue, 01 Sep 2009 18:09:04 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:164989</guid>
      <author>Arias</author>
      <link>http://userscripts.org/posts/164989</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Jarett</title>
      <description>&lt;p&gt;I don't know of a way to get any meta-data for the local copy of the script; however, Greasemonkey probably has a way to do it by now.&lt;/p&gt;</description>
      <pubDate>Tue, 01 Sep 2009 02:36:56 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:164753</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/164753</link>
    </item>
    <item>
      <title>How to get the @version ?, replied by Arias</title>
      <description>&lt;p&gt;Is there anyway to make var for @version from local and remote ?&lt;/p&gt;

&lt;p&gt;So you can see the &quot;real&quot; version number instead av the version number that its getting now. &lt;/p&gt;

&lt;p&gt;Thanks for the code btw !&lt;/p&gt;</description>
      <pubDate>Mon, 31 Aug 2009 23:59:02 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:34236:164722</guid>
      <author>Arias</author>
      <link>http://userscripts.org/posts/164722</link>
    </item>
    <item>
      <title>No longer works, replied by Jarett</title>
      <description>&lt;p&gt;Works now. I changed it to use meta.js instead of scraping the source page; when I made this script, there was no meta.js. I also had to walk uphill both ways in the snow just to get to a computer. Whippersnappers...&lt;/p&gt;</description>
      <pubDate>Thu, 30 Apr 2009 03:59:27 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25116:116242</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/116242</link>
    </item>
    <item>
      <title>No longer works, replied by niknah</title>
      <description>&lt;p&gt;This script no longer works because usersripts.org are printing the source code out differently now.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Apr 2009 05:40:55 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25116:112347</guid>
      <author>niknah</author>
      <link>http://userscripts.org/posts/112347</link>
    </item>
    <item>
      <title>Archived Comments, replied by greasefury</title>
      <description>&lt;p&gt;Hi!
&lt;br /&gt;Thank you for your great script! I just added it to my &lt;a href=&quot;http://userscripts.org/scripts/show/32535&quot;&gt;dummy_free_fm4_notes&lt;/a&gt; script. 
&lt;br /&gt;Great how easy to use it is!&lt;/p&gt;</description>
      <pubDate>Tue, 21 Oct 2008 11:57:20 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43915</guid>
      <author>greasefury</author>
      <link>http://userscripts.org/posts/43915</link>
    </item>
    <item>
      <title>Archived Comments, replied by Jarett</title>
      <description>&lt;p&gt;Cool, thanks.&lt;/p&gt;</description>
      <pubDate>Thu, 21 Aug 2008 03:29:40 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43916</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/43916</link>
    </item>
    <item>
      <title>Archived Comments, replied by Mario Huys</title>
      <description>&lt;p&gt;Because updating timestamps by hand is tedious, I've made the &quot;Script Timestamp Updater&quot; script ( &lt;a href=&quot;http://userscripts.org/scripts/show/32137&quot;&gt;http://userscripts.org/scripts/show/32137&lt;/a&gt; ). Each time you &quot;manually&quot; edit a script and save it, it will update the version_timestamp variable. Does not work when uploading a script file.&lt;/p&gt;

&lt;p&gt;Contains its own Script Update Checker snippet, so anyone who downloads it will be duly informed of any updates. Note the extra 'if(version_timestamp){...}' around the Checker code. As the script developer I don't want to be informed of any updates, hence my master copy has version_timestamp set to 0 and the extra if() takes care of the rest. Could also be done by setting an extremely high timestamp, but I like to make things explicit.&lt;/p&gt;

&lt;p&gt;Edit: Now also updates the script number. It's now ok to set both variables to 0 in your master script, and leave the rest to the script. If you upload from file, after saving return once more to the 'Edit source' page and push the Save button again to ensure that these variables are correctly updated.&lt;/p&gt;</description>
      <pubDate>Wed, 20 Aug 2008 09:47:06 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43917</guid>
      <author>Mario Huys</author>
      <link>http://userscripts.org/posts/43917</link>
    </item>
    <item>
      <title>Archived Comments, replied by jesus2099</title>
      <description>&lt;p&gt;Hi Jarett !&lt;/p&gt;

&lt;p&gt;I'm using Opera which does not have support for &lt;code&gt;GM_*&lt;/code&gt; functions. As you script is nice it's getting spread in many other scripts now.&lt;/p&gt;

&lt;p&gt;Maybe you would like to add a &lt;code&gt;try { &#8230; } catche(e) {}&lt;/code&gt; around the &lt;code&gt;function updateCheck(forced) { &#8230;&lt;/code&gt; in order not to make those scripts fail, even if they would be Opera friendly otherwise (ie. not using any &lt;code&gt;GM_*&lt;/code&gt; function).&lt;/p&gt;

&lt;p&gt;Example: &lt;a href=&quot;http://userscripts.org/scripts/show/8266&quot;&gt;MusicBrainz Subscriptions&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 28 Jun 2008 06:30:33 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43918</guid>
      <author>jesus2099</author>
      <link>http://userscripts.org/posts/43918</link>
    </item>
    <item>
      <title>Archived Comments, replied by Astaroth</title>
      <description>&lt;p&gt;I'm start using your script with a less modification in my &quot;BattleKnight Autologin&quot; Script ( &lt;a href=&quot;http://userscripts.org/scripts/show/23744&quot;&gt;http://userscripts.org/scripts/show/23744&lt;/a&gt; ).&lt;/p&gt;</description>
      <pubDate>Mon, 10 Mar 2008 14:06:39 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43919</guid>
      <author>Astaroth</author>
      <link>http://userscripts.org/posts/43919</link>
    </item>
    <item>
      <title>Archived Comments, replied by Vaughan Chandler</title>
      <description>&lt;p&gt;Hi, thanks a lot for this script. I started using it in my script Facebook Fixer today ( &lt;a href=&quot;http://userscripts.org/scripts/show/8861&quot;&gt;http://userscripts.org/scripts/show/8861&lt;/a&gt; ) and I included a links to your profile and to this script. I would greatly appreciate a link back in your &quot;scripts using update checker&quot; section. Thanks :)&lt;/p&gt;</description>
      <pubDate>Sun, 09 Mar 2008 21:42:28 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43920</guid>
      <author>Vaughan Chandler</author>
      <link>http://userscripts.org/posts/43920</link>
    </item>
    <item>
      <title>Archived Comments, replied by Jarett</title>
      <description>&lt;p&gt;Thanks! I think both of those are useful additions. I was also going to change it to take the user to the script page instead of the actual script if it's hosted on userscrips.org; that way they can see what changes have been made to the script before they upgrade. I'll include your changes in the update.&lt;/p&gt;</description>
      <pubDate>Sat, 16 Feb 2008 23:41:24 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43921</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/43921</link>
    </item>
    <item>
      <title>Archived Comments, replied by ngattuso</title>
      <description>&lt;p&gt;Nice script. I extended it a little to add error handling and messages for forced updates through the menu. I kept it generic so you could include it here for everyone. The src is at the bottom of my Facebook GM script. Good work&lt;/p&gt;</description>
      <pubDate>Sat, 16 Feb 2008 05:20:10 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43922</guid>
      <author>ngattuso</author>
      <link>http://userscripts.org/posts/43922</link>
    </item>
    <item>
      <title>Archived Comments, replied by Jarett</title>
      <description>&lt;p&gt;That's the entire Greasemonkey philosophy.&lt;/p&gt;

&lt;p&gt;Or, at least, it's my philosophy that I apply to Greasemonkey scripts. :P&lt;/p&gt;</description>
      <pubDate>Sun, 27 Jan 2008 06:01:19 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43923</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/43923</link>
    </item>
    <item>
      <title>Archived Comments, replied by `Mods</title>
      <description>&lt;p&gt;Very good idea.
&lt;br /&gt;And very simple to use.&lt;/p&gt;</description>
      <pubDate>Sat, 26 Jan 2008 19:45:13 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43924</guid>
      <author>`Mods</author>
      <link>http://userscripts.org/posts/43924</link>
    </item>
    <item>
      <title>Archived Comments, replied by Jarett</title>
      <description>&lt;p&gt;Oh, I didn't even know about that function. I have actually been looking for a way around the popup blocker, so I'll change it in the source.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</description>
      <pubDate>Thu, 17 Jan 2008 02:15:58 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43925</guid>
      <author>Jarett</author>
      <link>http://userscripts.org/posts/43925</link>
    </item>
    <item>
      <title>Archived Comments, replied by BlindWanderer</title>
      <description>&lt;p&gt;I had problems with window.open (popup blocker) so I'm using GM_openInTab instead.&lt;/p&gt;</description>
      <pubDate>Wed, 16 Jan 2008 15:42:13 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:13608:43926</guid>
      <author>BlindWanderer</author>
      <link>http://userscripts.org/posts/43926</link>
    </item>
  </channel>
</rss>
