Jump to content
Ketarin forum

CybTekSol's Improved Generic Template


CybTekSol
 Share

Recommended Posts

My Improved Generic template:

 

NOTE: This is a improved version of my 'generic' template which I use when an

application is not hosted on one of the major sites for which I have an

existing template. It now allows you to input an 'anchor string' for

the {version} and {download_url} variable regex(s). This should be

characters that are recurring and exist BEFORE and NEAR the version or

download URL that you desire to match.

 

1) There are two user defined global variables used, download_url={download_url}

(used as an alternative to {url})

and

root_folder=Insert YOUR download destination ROOT folder here

[for example C:\Latest Downloads].

 

2) The latest version of Ketarin (1.0.5) released March 21, 2009 or later is required

as this revision uses 'variables within regex'.

 

3) The template follows:

<?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" />
   <VariableChangeIndicator>{version}</VariableChangeIndicator>
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <HttpReferer />
   <Variables>
     <item>
       <key>
         <string>anchor1</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>Textual</VariableType>
           <Regex />
           <TextualContent><placeholder name="Recurring 'Anchor String' BEFORE and NEAR Version Number? (Example: Version)" value="Version" /></TextualContent>
           <Name>anchor1</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>(?:{anchor1}.*?)(Beta.+?|Build.+?|\d.*?)(?:<|&)</Regex>
           <Url><placeholder name="URL to be 'scraped'?" /></Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>anchor2</string>
       </key>
       <value>
         <UrlVariable>
           <RegexRightToLeft>false</RegexRightToLeft>
           <VariableType>Textual</VariableType>
           <Regex />
           <TextualContent><placeholder name="Recurring 'Anchor String' BEFORE and NEAR URL? (Example: Download)" value="Download" /></TextualContent>
           <Name>anchor2</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>(?:{anchor2}.*?)(?:"|')(\w+:\/\/([\w@][\w.:@]+)\/?[\w\.?=%&=\-@/$,]*[\w\.?=%&=\-@/$.]*\.(?:exe|7z|zip|zip2|arc|bz|bz2|bzip|gz|gzip|jar|lha|lzh|lzw|pak|rar|sit|sit!|sit5|sitd|sithqx|sitx|tz|wsz|cab|msi|bin|img|iso|xpi|pbp))(?:"|')</Regex>
           <Url><placeholder name="URL to be 'scraped'?" /></Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <Category><placeholder name="Category?" value="New App" /></Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>false</DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <LastUpdated xsi:nil="true" />
   <TargetPath>{root_folder}\{category}\{appname:replace: :_}_v{version:replace: :_}.{url:ext}</TargetPath>
   <FixedDownloadUrl>{download_url}</FixedDownloadUrl>
   <Name><placeholder name="Application Name?" /></Name>
 </ApplicationJob>
</Jobs>

To use it:

 

1) Define the user defined global variables under 'Settings' in Ketarin to YOUR preferences

2) Edit the template externally to reflect these modifications (if you choose not to use

mine) and change the <TargetPath> line to YOUR preferences

3) Then:

a) Import it (Obviously)

B)Enter the information needed as requested as a result of the 'placeholder'

prompts... it will ask for regex anchors, the URL to be 'scraped' and the

application's name

c) Modify the Category to YOUR preferences

d) Change the 'Advanced Settings' to YOUR preferences

e) TWEAK the regular expressions for {version} and {download_url}... if needed

f) VERIFY...VERIFY...VERIFY that ALL regex matches WORK and

MAKE ADJUSTMENTS to them as necessary! REFINE it to YOUR NEEDS!

 

 

This template will give you a solid starting point with applications from sites that are simply too small to justify developing a template and the {version} and {download_url} regex(s) can be saved in your 'default template' if you Like them.

 

 

CybTekSol

Link to comment
Share on other sites

For the moment I don't use a generic template but I get similar results with the 'default application' job (or copy-paste an existing job) and a couple of regexes 'global variables' for version. If we get our dropdown menu, I'll dump everything into XML, it's much better, yeah. ;)

Link to comment
Share on other sites

For the moment I don't use a generic template but I get similar results with the 'default application' job (or copy-paste an existing job) and a couple of regexes 'global variables' for version.

I rotate using those methods as well... depends on my mood.

If we get our dropdown menu...

This will open up a new frontier of possibilities for templates indeed... I am anxiously anticipating it for sure. ;) (and cookie support)

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.