|
|
Hi, what is the best userscripts updater script? Thank you in advance! |
|
|
For including in your own script or for notifying your installed scripts? I nominate:
|
|
|
To jerone: Okay, given that you've nominated your own script, I'll nominate mine. :-) To kristof: I don't think you're going to get a definitive answer to this - everyone has their own preferences. lazyttrick's Userscripts Updater works even for scripts whose authors did nothing to accommodate updating (other than to put the script on us.o), but needs end users to take it upon their own initiative to install and configure the updater script. My own SelfUpdaterExample needs zero additional effort on the part of the end user to work, but needs the programmer to copy its code into any script needing updating. jerone's US_update takes a middle ground - scriptwrights need to be aware of it and call its functions, but end users also need to install a separate script to get its functionality. Which approach is better for you is largely a matter of where you happen to fall on the scriptwright-script user spectrum. |
|
|
very nice!
Here's an example
|
|
|
To "w35l3y": Your scripts take yet another approach - using Greasemonkey's Advantages: Disadvantages: @required file must reside separately on some Internet-accessible server - and us.o itself does not yet provide facilities for this.@required file is itself updated, either its URL must be changed, or users must be advised to uninstall and reinstall all the scripts which make use of it. |
|
|
Edit: I completely updated my code. All the variables are now contained within the object to prevent conflicts with the script and posted my auto-update script here. |
|
|
Maybe someone objective should make list of all pros and cons for all known (and up-to-date)update scripts. |
|
|
I toyed with this idea for a while and discarded it as too hackish. I use Lazytrick's Userscripts Updater and it does a decent job, but the real solution would be to get this included in Greasemonkey proper. This was composed in GM ticket #45, but that seems to have become broken, so I re-requested it just now as ticket 185, http://greasemonkey.devjavu.com/ticket/185 ... please go there and voice your opinions. Lazytrick's updater has almost 10,000 installs ... but Alien Scum's updater has over 28,000. Related discussion topics include:
|
|
|
To jerone: Maybe someone objectiveI don't know how one would go about finding such a person. :-) should make list of all pros and consSometimes it's hard even to decide which is which objectively; this discussion I had a while back includes such a difference of opinion. for all known (and up-to-date) update scripts.I also don't know whether these are up-to-date, but as a start for {whomever}, here are some more links - from the research I did before deciding to roll my own updater:
To khopesh: Alien Scum's updater has over 28,000If you find that meaningful, you should know that Gibson's updater has over 200,000. |
|
|
If you find that meaningful, you should know that Gibson's updater has over 200,000. Poorly written updaters will download scripts to see if an update is needed ... unfortunately, such downloads count as installs. A number like 200,000 probably includes update checks for already-installed instances. I wouldn't be surprised if Alien Scum's updater has the same flaw. Since I use lazytrick's updater, I could verify that that one does not contain this flaw (though perhaps it once did). The same flaw, this time in self-updating scripts, is likely the culprit for a good number of the impossibly high install counts for some scripts on this site. (Though I'd imagine many of those counts were inflated though other means for fun and/or profit.) |
|
|
I wouldn't be surprised if Alien Scum's updater has the same flaw. I believe it doesn't and never has. As I recall Alien Scum made it for that exact reason. I've not used that script in quite a while though; it used to work really well but then I think the latest update broke it for me. I personally don't actually use any script updaters any more; seeing how many there are on offer though, maybe I should consider it. Quite often I favourite the most useful scripts and take an if it ain't broke, don't fix it approach to the rest. |
|
|
Poorly written updaters will download scripts to see if an update is needed ... unfortunately, such downloads count as installs.In the beginning of my update script I thought people were downloading it every second. :P Then I found out the 'bug' and fixed it immediately. I don't think that after 1 1/2 years Alien's script will be ever updated.
|
|
|
I don't know if poorly written is the right word for calling |
|
|
@sizzlemctwizzle, That syntax is better as it doesn't trip over the install counter, but you need only examine the "last updated" date stamp. Saves bandwidth, processing, etc. |
|
|
@khopesh
|
|
|
To khopesh: you need only examine the "last updated" date stampThat'd also help with scripts whose authors forget to update the version number - or don't provide one - or provide one that isn't easily parsed. This won't deal with that, either, but FYI, when I was developing my script, Jesse added URLs of the form The ideal situation would be to just send a HEAD request and look at the date in the response, but I remember looking into this as a possibility when I was writing my script, and it doesn't work here since all the pages are built on the fly. |
|
|
Thank you so much scrooge! That is so awesome! I've already updated my script to use just the metadata. How come this isn't like in a FAQ or something? Can you use the last-updated method for the |
|
|
Just deployed that meta.js has the internal script id and version id. I can add uso:updated (timestamp) if that would help. Version IDs are NEVER reused and always increase |
|
|
I'm liking the @uso:version because that will work for all scripts and will take the hassle of having to change the version number manually for every update. What I would really like would be if you could set the last-update value in the response header of meta.js so I don't even have to parse the file at all. I know you can do that in PHP. I'm sure it can be done in rails too. I just don't know if it would interfere with your caching system. |
|
|
sizzlemctwizzle, we will have to keep changing the version number manually because @uso:* only works in *.meta.js
i think this is a good ideia but i don't think these @uso:* headers will change something. |
|
|
@w3513y
|
|
|
Thanks for the meta.js, Jesse.
|
|
|
... we will only have to parse the script for the version number if the timestamp is different from the value we've stored. stored where ?
the idea is very good but let's imagine the timezone of userscript.org is different from the scripter.
|
|
|
imagine the timezone of userscript.org is differentIrrelevant, if it's handled properly - meaning you assign the task of timestamping all the various versions to the same party every time (most likely either the scriptwright or us.o itself). Example:
If this seems to contradict my earlier statement that using a HEAD request would be easiest, it doesn't - so long as us.o's mechanism to ensure that this timestamp reflects the script's upload time also adds that same timestamp in the script text in a manner that makes it accessible to the script itself. OTOH, by making us.o responsible for managing the timestamping (or versioning or whatever), you end up with an update mechanism that only works for scripts hosted here on us.o. (Nothing against Jesse, but there are people who choose to host their scripts elsewhere, and it'd be nice to have the update function acknowledge and permit that.) |
|
|
First of all a few hours difference matters little if you're only checking for updates every once in a while. It requires far little accuracy since the most you could be off is a day. Second, we aren't comparing the last updated value with the time on the machine so timezones don't matter anyway. We are just using it so we don't have to parse the script if the last updated value remains the same. As a method of storage I was talking about GM_setValue. ScroogeMcPump's process is a lot like mine, but I was thinking something like: 1. User installs a version of the script.
@Scrooge: You have to make sure when the first time the script runs that the version is indeed what we have installed since a user is not guaranteed to run it right after they install. |