Jump to content
Ketarin forum

Softpedia.com Template (Test)


FranciscoR
 Share

Recommended Posts

<?xml version="1.0" encoding="utf-16"?>
<Jobs>
 <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <DownloadBeta>Default</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <CheckForUpdatesOnly><placeholder name="Check for updates only ?" value="false" options="true" /></CheckForUpdatesOnly>
   <VariableChangeIndicator />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>    
   <HttpReferer />
   <Variables>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>true</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(?<=href\=")(\w+\:\/\/[\w][\w\-?\w.:]+\/?[\w\s\.?=%&=\-/,\)\(]*)(?:".*?{linktext:replace: :[\s]*?}\<)</Regex>
           <Url><placeholder name="Download Page URL" /></Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(??<=<title>.+(?:.+/ ){<placeholder name="Version match group ? (for 'Firefox 3.5 Beta 4 / 3.0.10 / 2.0.0.20 / 1.5.0.12' use 0 for '3.5 Beta 4', 1 for '3.0.10' and so on)" value="0" options="0|1|2|3" />})(\d+(?:\.\w+)+(?: [a-z0-9().]+)*?)(?= ([-/[]{<placeholder name="Capture version in 1.x.x format ? (1 for NO, 0 for YES = excludes 'Alphas','Betas', 'Builds' from capture)" value="1" options="0|1" />}|free|stable|final))<placeholder name="Capture date ? (usually not necessary, just delete it)" value="|(?:[a-z]+ \d{1,2}[a-z]{2}, 20\d{2})" />)</Regex>
           <Url><placeholder name="Info Page URL" /></Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>      
     <item>
       <key>
         <string>linktext</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>Textual</VariableType>
           <Regex />
           <TextualContent><placeholder name="Download link TEXT (escape ANY regular expressions constructs => 'Softpedia Mirror \(RO\)')" value="External Mirror 1" options="Softpedia Secure Download \(US\)|Softpedia Secure Download \(RO\)|Softpedia Mirror \(US\)|Softpedia Mirror \(RO\)|External Mirror 1|External Mirror 2|External Mirror 3|External Mirror 4|Softpedia Secure Download \(US\) - Beta|Softpedia Secure Download \(RO\) - Beta|Softpedia Mirror \(US\) - Beta|Softpedia Mirror \(RO\) - Beta|External Mirror 1 - Beta|External Mirror 2 - Beta|External Mirror 3 - Beta|External Mirror 4 - Beta" /></TextualContent>
           <Name>linktext</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <ExecutePreCommand />
   <Category><placeholder name="Category" value="Test" options="Backup|Benchmark|Clean|Compression|Grep|Internet|Multimedia|Misc|Office|PDF|Recovery|Registry|Scrapbook|Security|Test|Virtualization" /></Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>false</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <LastUpdated xsi:nil="true" />
   <TargetPath>{target}\{category}\<placeholder name="Class" options="Diagramming\|Download\|Extensions\|Graphics\|Network\|Notepad\|Plugins\|ScreenCapture\|Test\|Uninstall\|USB\" /><placeholder name="Rename" value="{appname:replace:SP_:}_{version}.{url:ext}"  /></TargetPath>
   <FixedDownloadUrl>{download_url}</FixedDownloadUrl>
   <Name>SP_<placeholder name="AppName" /></Name>
 </ApplicationJob>
</Jobs>

 

Note: this template requires users to edit regular expressions. See a similar template and a short tutorial in http://ketarin.canneverbe.com/forum/viewtopic.php?pid=2223#p2223. Known Limitations: for the moment, none. Note: to use this template you need Ketarin 1.0.6b3 or above. Now you can select between multiple options:

35d157a.png

Edited by FranciscoR
Link to comment
Share on other sites

I look forward to the 'placeholder drop-down' feature for templates like this FranciscoR... especially for mirrors to be pre-programmed with the most frequent. It would be even more powerful if the 'drop-down' could be variable 'key tags' (with descriptions) for entire regex substitutions... i.e. ... there could be 3/4 choices which would substitute the entire version regex based on the desired release. Thoughts?

Link to comment
Share on other sites

'key tags' ? Like

 

'a'- regex #1

'b'- regex #2

 

OK, but what if i assign no key, i would see every option in dropdown right ? Actually i'm thinking that the easiest way to implement a dropdown menu is to change a bit XML structure, like html 'select'

 

<select name="cars">

<option value="a">Volvo</option>

<option value="b">Saab</option>

<option value="c" selected="selected">Fiat</option>

<option value="d">Audi</option>

</select>

 

This way - i think - we could have assigned keys 'a,b,c,d' with a preselected option. XML would grow vertical (like it should?) =D

 

-----------------------

Edited by FranciscoR
Link to comment
Share on other sites

I was thinking more along the lines of:

 

'choice1' = External Mirror 1 regex

'choice2' = External Mirror 2 regex

'choice3' = Softpedia Secure Download (US) regex

'choice4' = Softpedia Secure Download (RO) regex

 

referring to your template, but... yes, you are correct!

 

...preset to user's default choice of locations from their template.

 

The 'select' option would indeed work, I'm for whatever Flo can implement in the near future. ;)

Link to comment
Share on other sites

I was thinking more along the lines of:

 

'choice1' = External Mirror 1 regex

'choice2' = External Mirror 2 regex

'choice3' = Softpedia Secure Download (US) regex

'choice4' = Softpedia Secure Download (RO) regex

Ah, see what you mean, that would work for standard mirrors. Even if external mirrors (or SP mirrors) don't exist at all. And, in a page like the FF page http://www.softpedia.com/progDownload/Mozilla-Firefox-Final-Download-5787.html a mirror like 'Korea, Democratic People\'s Republic of installer' =) could be easily selected with a an empty box. You're 100% correct.

 

--------------------------

 

That <select> tag could also allow you to display only contents with assigned keys, think i like that. For instance, usign

 

<select name="cars">

<option value="a">Volvo</option>

<option value="a">Saab</option>

<option value="b" selected="selected">Fiat</option>

<option value="b">Audi</option>

</select>

 

Type 'a' and Ketarin menu will show

- Volvo

- Saab

 

Type 'b' and Ketarin menu will show

- Fiat

- Audi

 

Otherwise 'Fiat' is preselected and dropdown will show every field. I'm not the expert here, lets wait for Flo. ;)

Edited by FranciscoR
Link to comment
Share on other sites

Well I updated my template =), did like binary options a lot, and did see that [space] problem. What I cannot see is why your using that final non-capture group on dl_url (for me works fine without it) ? That page is more problematic then I first expected, it has sereral html typing 'errors'. =( Working on 'double' and 'triple space' now. But I do understand your need of a more user-friendly SP template, for me this should go in a new thread (or update yours).

 

----------------------

 

Edit: I'm done with that page. =)

Edited by FranciscoR
Link to comment
Share on other sites

Yeah, it's an excellent study material, like dutchclimber would say. It achives the same goal with a completly different method and your idea of prompting user to insert variable name (to specify regexes A,B,C) as a BIG POTENTIAL. Another first-time idea from you. ;) Unless SP changes everything I'll fine-tune the method I'm using right now so... let's have another post. BTW, I re-tested and updated my regexes again, ALL should be rolling smooth now. And I do like version this time. =)

Link to comment
Share on other sites

Hi,

 

I get this error when I try to import your template:

 

sp_error.png

 

It seems that Ketarin (I use the latest version 1.0.6.272) has a problem with the character "\" in this line: <ExecuteCommand \>

 

Do you have an idea what I did wrong?

 

Best regards

 

Mischa

Link to comment
Share on other sites

It should be <ExecuteCommand /> instead of <ExecuteCommand \> (ForwardSlash instead of BackSlash). Sorry I didn't catch that when I referenced it earlier. It's simply a typo on FranciscoR's part... I'll correct that and the <ExecutePreCommand \> typo to <ExecutePreCommand /> in the template for FranciscoR. ;)

Link to comment
Share on other sites

Sorry about that, i slashed the wrong way during some update. =) That's no big deal, and in general Ketarin tells you where the error is, but if you want to validate XML syntax prior to use, go to http://validator.w3.org/#validate-by-input, paste the selected code there, and press 'check'.

 

You should get the message

This document was successfully checked as well-formed XML!

Link to comment
Share on other sites

Thanks, I corrected it and now I can import the template - but I've still got another problem :(

 

I tried to download Audacity from SP and inserted all desired information in the pop-ups - this is the resulting XML:

 

<?xml version="1.0" encoding="utf-16"?>
<Jobs>
 <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="664a281f-f72b-4c75-823a-3225dc391e43">
   <DownloadBeta>Default</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
   <VariableChangeIndicator />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <HttpReferer>http://www.softpedia.com/progDownload/Audacity-Download-1970.html</HttpReferer>
   <Variables>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(??<=\<title\>Download.*?(?:.*?\/){0}\s)(\d+(?:\.\d+)+?(?:.*?){1})(?=\s[\-\/\[]{1}))</Regex>
           <Url>http://www.softpedia.com/get/Multimedia/Audio/Audio-Editors-Recorders/Audacity.shtml</Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>true</RegexRightToLeft>
           <VariableType>RegularExpression</VariableType>
           <Regex>(?<=href\=")(\w+\:\/\/[\w][\w\-?\w.:]+\/?[\w\s\.?=%&=\-/,\)\(]*)(?:".*?{linktext:replace: :[\s]*?}\<)</Regex>
           <Url>http://www.softpedia.com/progDownload/Audacity-Download-1970.html</Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>linktext</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>Textual</VariableType>
           <Regex />
           <TextualContent>External Mirror 1</TextualContent>
           <Name>linktext</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <ExecutePreCommand />
   <Category>Multimedia</Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>false</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <LastUpdated xsi:nil="true" />
   <TargetPath>D:\ACER_XP\Software allgemein\{category}\{appname} {version}.{url:ext}</TargetPath>
   <FixedDownloadUrl>{download_url}</FixedDownloadUrl>
   <Name>SP_Audacity</Name>
 </ApplicationJob>
</Jobs>

 

The download doesn't work, maybe you can tell me why?

 

Best regards and thanks for your help

 

cool400 :cool:

Link to comment
Share on other sites

???

 

So SP refers to SF, right? Could you please tell me what exactly I have to do when using your script? Do I have to leave any fields blank? Or do I have to modify anything in the XML-file?

 

Sorry for bothering you that often.

 

cool400 :cool:

Link to comment
Share on other sites

Ok, the problem is the following:

 

- I can't remove the http referer because that would break other DLs;

- I can't create an option to disable it because there's no variable support with referer (already requested, see http://ketarin.canneverbe.com/forum/viewtopic.php?pid=2050#p2050);

- So if and when you find such a problem (not too common) you need to go to Edit>Advanced Settings>'Spoof Http Referer' and manually remove all existing content (leave it empty).

- Or add a different placeholder for your <httpreferer> tag.

 

Feel free to propose a better alternative, always. =)

 

---------------------------

Edited by FranciscoR
Link to comment
Share on other sites

I have discovered a 'nasty little secret' regarding SoftPedia today FranciscoR. :( Unfortunately, there is no solution I can think of to overcome this. I had both the beta and stable versions of Floola setup as separate downloads from a 'dual-version' page and with the latest release SoftPedia reverted to a 'single-version' page which killed both my configured downloads! That sucks! Have you had that happen before or is this an anomaly? I find myself relying more and more on SnapFiles these days as their site has been the most consistent by far (so far). Combine this development with the MajorGeeks failure and this has been a depressing week for me with downloads. :(

Link to comment
Share on other sites

Hi Francisco,

 

I recognized something strange: some downloads are extended with the words "Free Trial", although I can't see this anywhere on the Info-/Download-page (and I really don't like it)!

 

You can test this with http://www.softpedia.com/progDownload/DAEMON-Tools-Download-5319.html.

 

Is there any way to stop this behaviour?

 

Best regards and thanks for your precious work

 

cool400 :cool:

 

P.S. There seems to be another problem that I can't figure out with DriveImage XML: http://www.softpedia.com/get/System/Hard-Disk-Utils/DriveImage-XML.shtml

Edited by cool400
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.