What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Tutorial: Script update checking

Pages: (2): « First « 1 [ 2 ] Last »
Tutorial: Script update checking
Author: Message:
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
O.P. RE: Tutorial: Script update checking
quote:
Originally posted by MenthiX
Yeah, those are the kind of tutorials i like to see (Smilie)
thanks and a writing multi-language class tutorial would be quite a bit harder :(

but if nobody else wants to do it :P I'll write something up for it

quote:
Originally posted by Dempsey
That's great!  would you mind if I use it on mpscripts tutorial section?
sure, contact me on messenger and I'll send you the raw tutorial


quote:
Originally posted by john-t
Great article. :im: going to learn to code this will be great. Can i submit this to dig?   

Thanks. john-t rating of 9.1 - 9.9 / 10 ;)
no digging :P


This post was edited on 11-11-2007 at 10:40 PM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
11-11-2007 10:38 PM
Profile PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: Tutorial: Script update checking
* Stigmata 's method takes up half the space

code:
function CheckForUpdates(foo)
{
var xmlhttpup = new ActiveXObject("MSXML2.ServerXMLHTTP");
     xmlhttpup.open("GET", "http://www.msgpluslive.net/scripts/view/309-Myspace-Manager/",true);
     xmlhttpup.onreadystatechange=function() {
          if (xmlhttpup.readyState==4) {
              var pos=xmlhttpup.responseText.indexOf('<span class="largefilename">Myspace Manager ');
            var ver=xmlhttpup.responseText.substring(pos+44)
            pos=ver.indexOf('</span><br />');
            ver=ver.substring(0,pos)
             
               Debug.Trace('Ver On Server: ' + ver + ' - Ver On Disk: ' + MyVer);
               if(ver > MyVer){ Toast('New Version Available!\r\n\r\nClick here to download');}
                if((foo) & (ver <= MyVer)){Toast('No New Updates Available!');}
          }
     }
xmlhttpup.send(null);
}



if foo == true, a toast popup will be displayed saying no update is available, else no toast popup.


is this a bad way to do it or something? because to me it seems like a lot less hassle and quicker etc...
11-11-2007 11:08 PM
Profile PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Tutorial: Script update checking
Sorry stiggy but that code needs to be optimised.
code:
function CheckForUpdates(foo)
{
var xmlhttpup = new ActiveXObject("MSXML2.ServerXMLHTTP");
xmlhttpup.open("GET", "http://www.msgpluslive.net/scripts/view/309-Myspace-Manager/",true);
xmlhttpup.onreadystatechange=function() {
  if (xmlhttpup.readyState==4) {
  var ver = RegExp('<span class="largefilename">Myspace Manager(.*)</span><br />','i').exec(xmlhttpup.responseText);
    ver = ver[1];
    Debug.Trace('Ver On Server: ' + ver + ' - Ver On Disk: ' + MyVer);
    if(ver > MyVer){ Toast('New Version Available!\r\n\r\nClick here to download');}
    else if(foo){Toast('No New Updates Available!');}
  }
}
xmlhttpup.send(null);
}
I'll admit to not testing this before posting but it does look a lot nicer doesn't it?

Anyway, I like to make t ext file and check the build number against the number in there personally, but it wasn't a bad read.  I think any of us who do a lot of scripting ill probably use our own methods for this kind of thing but it will definitely be nice for the new scripters to have this functionality as well.
[Image: markee.png]
11-11-2007 11:42 PM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
O.P. RE: Tutorial: Script update checking
quote:
Originally posted by Stigmata
is this a bad way to do it or something? because to me it seems like a lot less hassle and quicker etc...

quote:
Originally posted by markee
Anyway, I like to make t ext file and check the build number against the number in there personally

Personally I keep all my scripts with subversion, so its easier for me to check the ScriptInfo.xml (eg http://version.thedt.net/scripts/plusscripts/musi...ing/ScriptInfo.xml ) rather than to update some random text file and check that.

plus I think its easier for people just to upload a copy of the scriptInfo.xml rather than to parse a webpage or upload a random text file
[Image: dt2.0v2.png]      Happy Birthday, WDZ
11-12-2007 12:03 AM
Profile PM Web Find Quote Report
Lou
Veteran Member
*****

Avatar

Posts: 2475
Reputation: 43
– / Male / Flag
Joined: Aug 2004
RE: Tutorial: Script update checking
Wow! That's a huge tutorial. If I ever get a good idea for a script, I'll use it :P.
[Image: msghelp.net.png]
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
11-12-2007 02:04 AM
Profile PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
34 / Male / Flag
Joined: Oct 2004
RE: Tutorial: Script update checking
dt's tutorial is good because it also allows retrieval of release notes and such all in one go. The tutorial is great, but it does this all just to ultimately check the version number in the end whereas so much more could be done (as he does in his actual scripts) using the extra data.

For simply retrieving version number something like Stigmata's code is fine although I personally use a PHP script. The Plus script requests page (www.whatever.com/version.php?name=Plus!Mail), the PHP script then retrieves the appropriate latest version number from database and returns it.
I like this method because it allows multiple scripts to be checked using the same system and a single URL (with a different 'name' parameter).

Either way, good job on releasing this tutorial dt. Glad to see people focused on helping others (Y)
11-12-2007 02:18 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Tutorial: Script update checking
That's great. This is the kind of thing that makes me think I need a tutorials section in the scripts page off msgpluslive.net.
[Image: signature2.gif]
11-12-2007 04:22 AM
Profile PM Web Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Tutorial: Script update checking
quote:
Originally posted by Patchou
That's great. This is the kind of thing that makes me think I need a tutorials section in the scripts page off msgpluslive.net.
you do ;o i need somewhere to post my window tutorials =o
11-12-2007 05:56 AM
Profile PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On