MadDog Posted January 1, 2009 Report Share Posted January 1, 2009 Hi, just wondering about the proper way to get version numbers. I've a number of downloads where the version number on the webpage is seperated with a period, but isn't in the filename. Example: Realtek High Definition Audio for Vista (uploaded to the database) The downloadfile is ftp://61.56.69.18/pc/audio/Vista_R213.exe The version number on the website is 2.13 I put "2" in variable v1 (startsearch "Realtek High Definition Audio Codecs for Windows Vista ", endsearch ".") And I put "13" in variable v2. (startsearch "Realtek High Definition Audio Codecs for Windows Vista 2.", endsearch "<") The downloadurl is: ftp://61.56.69.18/pc/audio/Vista_R{v1}{v2}.exe It works, but will of course stop working if the major version number (2) changes, as it is hardcoded in the search. I'm wondering if anyone knows a better download/search definition to get such downloads. (The solution of all problems would be of course to use previous variables in start/end search, but this is probably way too complicated to implement.) Oh, btw: Ketarin rules! Probably the best freeware tool I found in 2008. Link to comment Share on other sites More sharing options...
floele Posted January 1, 2009 Report Share Posted January 1, 2009 Thanks for the nice comment! Regarding the version: In your case, you could try scraping it using regular expressions instead of start/end. Another approch is to provide a functionality for string replacement within variables, I'd just need to find some nice syntax. Link to comment Share on other sites More sharing options...
Stalker Posted January 1, 2009 Report Share Posted January 1, 2009 Well, *NIX tr's syntax is nice for such thing. Array of what's and array of with's. Although in case of tr it only works on symbols, not full strings. Link to comment Share on other sites More sharing options...
floele Posted January 1, 2009 Report Share Posted January 1, 2009 I guess that such a syntax is just too much for Ketarin. It needs to be very simple. Maybe something like {varname:replace:_:} Link to comment Share on other sites More sharing options...
floele Posted January 2, 2009 Report Share Posted January 2, 2009 Could some of you maybe do some testing regarding the variable functions? Currently, I implemented replace as mentioned above, tolower, toupper and trim. Maybe you have more useful suggestions? Link to comment Share on other sites More sharing options...
Stalker Posted January 2, 2009 Report Share Posted January 2, 2009 Well, seeing that the most common problem is having dots in version variable and not having dots in the link itself I guess that would be more than enough. As for the testing I could land a hand. Link to comment Share on other sites More sharing options...
floele Posted January 3, 2009 Report Share Posted January 3, 2009 Ops, didn't I post a link!? http://ketarin.canneverbe.com/downloads/Ketarin/Ketarin-0.9.9.19a.zip Link to comment Share on other sites More sharing options...
MadDog Posted January 3, 2009 Author Report Share Posted January 3, 2009 (edited) Hi, thanks for the responses. I'm afraid I'm too dumb for regular expressions. :/ It's too complicated for me. But thanks for the nice and simple approach! > Ops, didn't I post a link!? I was just trying out the new features with 0.9.9.18, but couldn't get it working. While writing a "duh? It doesn't work" reply, you posted the new version. I changed the URLs and these two work fine: version = 2.13 ftp://66.104.77.130/pc/audio/WDM_R{version:replace:.:}.exe ftp://61.56.69.18/pc/audio/Vista_R{version:replace:.:}.exe Download URL: ftp://61.56.69.18/pc/audio/Vista_R213.exe So, thanks. This modification helps a lot. :cool: For suggestions, adding {varname:trimleft:_} {varname:trimright:_} would be great. But not specifing a count length, but a character. Because then even quite complicated URLs could be generated and would still work if the major/minor version changes. (Like version 10.01) Example: Version = 9.0 {version:trimleft:.} = 9 {version:trimright:.} = 0 The URL for Acrobat Reader (German) would be ....://ardownload.adobe.com/pub/adobe/reader/win/{version:trimleft:.}.x/{version}/deu/AdbeRdr{version:replace:.:}_de_DE.exe ( ....://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.0/deu/AdbeRdr90_de_DE.exe ) Edited January 3, 2009 by MadDog Link to comment Share on other sites More sharing options...
MadDog Posted January 3, 2009 Author Report Share Posted January 3, 2009 (edited) While doing another test, I might have found a bug, or something. I've used the new variable:replace command in following profiles (uploaded to the database): Realtek High Definition Audio for 2K/XP/03 Realtek High Definition Audio for Vista Opera (International) Trying to update the Realtek profiles, if the file already exists, results in an error, the progress bar keeps looping or it downloads again. Trying to update Opera works always. If the file exists, it won't update. No error. I'm wondering if there's a bug in Ketarin, or if the Realtek servers are just stupid? Edited January 3, 2009 by MadDog Link to comment Share on other sites More sharing options...
floele Posted January 3, 2009 Report Share Posted January 3, 2009 I'll add trimstart and trimend, both with and without parameters. The Realtek servers suck. They are even too slow for actually testing whether or not there is a problem I'd suggest to find some better servers instead. Link to comment Share on other sites More sharing options...
MadDog Posted January 3, 2009 Author Report Share Posted January 3, 2009 OK, thanks. I found better servers and it works without problems. Looking forward to the new version. Link to comment Share on other sites More sharing options...
Stalker Posted January 3, 2009 Report Share Posted January 3, 2009 I tried replace with a few links and it works like a charm. At least with dots. Haven't yet found a program which would require something other than dot replacement. Link to comment Share on other sites More sharing options...
MadDog Posted January 7, 2009 Author Report Share Posted January 7, 2009 I'll add trimstart and trimend, both with and without parameters. Thanks again for implementing functions. Seeing your regex example from some other thread, I learned most can be done with various regexpress variables, but functions are still nice to use. I'm wondering how to use Trimstart/Trimend. I can't figure it out. Could you give me an example, please? Here's another idea for a function: {variablename:split:argument1:argument2} Example: Version = 9.10.151.156 {version:split:.:1} = 9 {version:split:.:3} = 151 Link to comment Share on other sites More sharing options...
floele Posted January 7, 2009 Report Share Posted January 7, 2009 "Split" is a good idea. Regarding trimend: version = 3.5.6. version:trimend:. = 3.5.6 version:trimstart:.3 = 5.6. Link to comment Share on other sites More sharing options...
MadDog Posted January 8, 2009 Author Report Share Posted January 8, 2009 (edited) I downloaded the 0.9.9.20 version from the other thread and gave it a try. Thanks for implementing this function. I was afraid "split" would be a too complicated function, but now it's there. This really solves all issues someone can have with version numbers. Now, where's the Donate button? (edit: moved my test examples to tutorial...) Edited January 8, 2009 by MadDog Link to comment Share on other sites More sharing options...
floele Posted January 8, 2009 Report Share Posted January 8, 2009 There's no donate button yet But glad to see that it works well. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now