Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install
Userscript Auto-Update Add-in (NOT FOR INSTALL)
<b>*DO NOT INSTALL THIS SCRIPT, DO COPY & PASTE IN YOUR OWN SCRIPT*</b><br> Use this code in your script to add weekly update checks and manual update.<br> <b>Update</b> : lastupdatecheck.getTime(), fixed. (Line 40)
This code is used in my Video Focus script to check if a new version is available either weekly or manually by the user.
How to use :
1. Copy & Paste the source into your own userscript.
2. Call CheckForUpdate() wherever in your script to verify if the time has come to look for a new version.
3. Don't forget to set these variables according to your own script :
var script_title = "Video Focus";
var source_location = "http://userscripts.org/scripts/source/19701.user.js";
var current_version = "1.0.4";
var gm_updateparam = "videofocus_lastupdatecheck";
GM_registerMenuCommand("VF->Force Update", CheckVersion);
4. A text document (in this case located on Google Docs) is used to store the latest version number,
do not forget to change that variable as well to reflect where your version holder file is located.
var version_holder = "http://docs.google.com/RawDocContents?docID=df8kjzj6_0fxs3wsfp&ju
Content example of the version holder file : "version=1.0.4" (without quotation marks)
|
|
I think that I found an error on line 40
(I gave the name "lastupdatecheck2" but could be anything else) Sorry for my bad english =/ |
|
|
83 people haven't listened hahaha lol |
|
|
Thanks Phanboy, I guess I forgot the configuration values can't be dates. Code updated. |
|
|
From FireFox error console: lastupdatecheck.getTime(), function getTime() does not exist. I've figure out a way around this though, since you already have the date variable as a string, you can do var lastupdatecheck = new Date(lastupdatecheck).getTime(); this should work better because you are converting it back into a Date() object. Your code before was trying to call .getTime() on a string object! lolz ;3 |
|
|
For a concrete example, look at Video Focus 1.0.4, it's the same auto-update code. |
|
|
Dink, I think I've made the instruction as user-friendly as possible.. Copy & paste the source code into your own script, change what needs to be changed (6 parameters in total, dont forget to make your version_holder file) and call the CheckForUpdate function at an appropriate place in your script. |
|
|
And nobody can modify that file but me, you can set that in the document options on Google Docs. |
|
|
I think alot of people like myself need more detailed instructions on how to use this code... |
|
|
You can use your own file from wherever, just make sure the version line is matched correctly. |
|
|
nice, i'll have to try this. now do i HAVE to use your google document or can i create my own? call me paranoid, but it's weird to have someone else in control of your variables and whatnot. |
You could comment on this script if you were logged in.
