Concerning updater scripts

Discuss and share scripts and script files...
serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Concerning updater scripts

Post by serendipity »

admin wrote:Sorry, but not possible. Simply not enough time. :|
I know you dont have the time for these things, but something like this would satisfy you?
It strips off all links from beta page, and makes no other changes:

Code: Select all

  $url=readurl("http://www.xyplorer.com/xyfc/viewtopic.php?f=1&t=4&sd=d",1,0,2);
  $url= replace($url, '"./', '"http://www.xyplorer.com/xyfc/');
  $url=regexreplace($url, '</?a(|\s+[^>]+)>', '');
  $url=replace($url, 'No-Install Package', '<a href="xys:http://www.xyplorer.com/download/xyplorer_11.60_beta_noinstall.zip"> No-Install Package</a>');
  $check=html("$url","85%","85%");
  IF($check Like "http://www.xyplorer.com/download*"){
  status "download";
  }
  ELSE{
  status "Script closed";
  }

admin
Site Admin
Posts: 66298
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Concerning updater scripts

Post by admin »

serendipity wrote:
admin wrote:Sorry, but not possible. Simply not enough time. :|
I know you dont have the time for these things, but something like this would satisfy you?
It strips off all links from beta page, and makes no other changes:

Code: Select all

  $url=readurl("http://www.xyplorer.com/xyfc/viewtopic.php?f=1&t=4&sd=d",1,0,2);
  $url= replace($url, '"./', '"http://www.xyplorer.com/xyfc/');
  $url=regexreplace($url, '</?a(|\s+[^>]+)>', '');
  $url=replace($url, 'No-Install Package', '<a href="xys:http://www.xyplorer.com/download/xyplorer_11.60_beta_noinstall.zip"> No-Install Package</a>');
  $check=html("$url","85%","85%");
  IF($check Like "http://www.xyplorer.com/download*"){
  status "download";
  }
  ELSE{
  status "Script closed";
  }
Looks good.

But note that it's not about my satisfaction. I just wanted to express my personal opinion and a warning. I have done that now. You can do what you want. I gave you the tool, it's your choice and responsibility what you do with it. Your script is another tool, a meta-tool if you like. Again, whoever uses the script should know what he's doing. If I were you I would tag a fierce warning to the beginning of the script (plus "do not show this again" option) and that's it. So, please disregard my mumbling! I'm just the swordsmith, you are the fighter. :mrgreen:

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Concerning updater scripts

Post by serendipity »

admin wrote:
serendipity wrote:
admin wrote:Sorry, but not possible. Simply not enough time. :|
I know you dont have the time for these things, but something like this would satisfy you?
It strips off all links from beta page, and makes no other changes:

Code: Select all

  $url=readurl("http://www.xyplorer.com/xyfc/viewtopic.php?f=1&t=4&sd=d",1,0,2);
  $url= replace($url, '"./', '"http://www.xyplorer.com/xyfc/');
  $url=regexreplace($url, '</?a(|\s+[^>]+)>', '');
  $url=replace($url, 'No-Install Package', '<a href="xys:http://www.xyplorer.com/download/xyplorer_11.60_beta_noinstall.zip"> No-Install Package</a>');
  $check=html("$url","85%","85%");
  IF($check Like "http://www.xyplorer.com/download*"){
  status "download";
  }
  ELSE{
  status "Script closed";
  }
Looks good.

But note that it's not about my satisfaction. I just wanted to express my personal opinion and a warning. I have done that now. You can do what you want. I gave you the tool, it's your choice and responsibility what you do with it. Your script is another tool, a meta-tool if you like. Again, whoever uses the script should know what he's doing. If I were you I would tag a fierce warning to the beginning of the script (plus "do not show this again" option) and that's it. So, please disregard my mumbling! I'm just the swordsmith, you are the fighter. :mrgreen:
OK, good to know. Will include an obvious disclaimer about betas. Thanks.

Filehero
Posts: 2731
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Concerning updater scripts

Post by Filehero »

serendipity wrote:Will include an obvious disclaimer about betas.
This is what I was just about to suggest here.

Beside that, I'm so brain-dead that I still didn't really get what the snippet you posted really does and address. :mrgreen:
... Oh Lord, I hope my current project will find an end some day.


Cheers,
Filehero

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Concerning updater scripts

Post by serendipity »

Filehero wrote:
serendipity wrote:Will include an obvious disclaimer about betas.
This is what I was just about to suggest here.

Beside that, I'm so brain-dead that I still didn't really get what the snippet you posted really does and address. :mrgreen:
... Oh Lord, I hope my current project will find an end some day.
Cheers,
Filehero
I was just putting forth a sample script to Don to show that an entire page from beta change log can be replicated into XY script without much change. A way to guarantee that users see the exact same page as beta page.

Filehero
Posts: 2731
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Concerning updater scripts

Post by Filehero »

serendipity wrote:I was just putting forth a sample script to Don to show that an entire page from beta change log can be replicated into XY script without much change. A way to guarantee that users see the exact same page as beta page.
Thanks for reverse engineering. :wink:

Good approach. The only improvement left I could think of is creating an image/snapshot from the web-page, but I have no idea wether such services even exist (apart from introducing another dependency...).

I think, combined with (or turned into) a disclaimer, this is safety-belt enough. To me this script is a major time-saver.


Cheers,
Filehero

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Concerning updater scripts

Post by serendipity »

Filehero wrote: The only improvement left I could think of is creating an image/snapshot from the web-page, but I have no idea wether such services even exist (apart from introducing another dependency...).
I think, combined with (or turned into) a disclaimer, this is safety-belt enough. To me this script is a major time-saver.
I did not understand the snapshot thing, you mean show XY main page?

Filehero
Posts: 2731
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Concerning updater scripts

Post by Filehero »

serendipity wrote:I did not understand the snapshot thing, you mean show XY main page?
Your and Marcos approach is almost the optimum which would be making a "real" snapshot by taking a "screenshot" of the beta change log without any change.

Cheers,
Filehero

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Concerning updater scripts

Post by Marco »

Filehero wrote:Your and Marcos approach is almost the optimum which would be making a "real" snapshot by taking a "screenshot" of the beta change log without any change.

Cheers,
Filehero
I don't think is possible with our means (I know FF can with an addon).
Meanwhile I slightly updated the code above

Code: Select all

 global $g_url;
 $g_url = "http://www.xyplorer.com/xyfc/viewtopic.php?f=1&t=4&sd=d";
 sub "_Browse and Download";

"_Browse and Download"
 global $g_url;

 $html = readurl ($g_url, 1, 0, 2);
 $html = replace ($html, '"./', '"'.regexreplace ($g_url, '(.*/)(.*)', '$1'));
 $html = replace ($html, '<a href="http://www.xyplorer.com', '<a href="xys:http://www.xyplorer.com');

 $g_url = html ("$html", 85%, 85%);

 if ($g_url Like "http://www.xyplorer.com*noinstall.zip") {
  status "download"; //download url, [targetfile], [options]
 }
 elseif ($g_url Like "http://www.xyplorer.com/xyfc*") {
  sub "_Browse and Download";
 };
any relative path in the html code is turned absolute, and all links pointing inside xyplorer.com domain are marked special with the xys: notation. A click on a zip file will trigger the download, a click on any other forum link will loop the script, so one can go to previous pages of changelogs.
Drawbacks: I can get site pages (not forum ones) show properly, and links like the ones in this post ( http://www.xyplorer.com/xyfc/viewtopic. ... 361#p76361 ) don't get the xys: prefix.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Filehero
Posts: 2731
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Concerning updater scripts

Post by Filehero »

Hi Marco, hi serendipity,
Marco wrote:I don't think is possible with our means (I know FF can with an addon).
Damned language barrier, I wanted to say: "Hey guys, you did it - it ain't gonna get better in real life!" :appl:


Cheers,
Filehero

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Concerning updater scripts

Post by serendipity »

Filehero wrote:Meanwhile I slightly updated the code above
Looking good. Maybe we continue this in the main script page so others can follow?
Also, if you have time you can go ahead and incorporate it in the main script.
I dont have the time until Friday Evening, so feel to post a new update if you like.
Few thoughts: maybe disable some links like installer which this script wont help with?
Maybe you can disable link which will take user elsewhere, i.e. beyond the realm of this script?

Post Reply