Jump to content
Ketarin forum

CybTekSol's EXAMPLE Generic Template


CybTekSol
 Share

Recommended Posts

My EXAMPLE Generic template:

 

NOTE: This is a simplified 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.

 

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 (.0.9.9.22) released January 18, 2009 or later is required

as this revision uses the new 'placeholder' feature implemented by Florian.

 

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 />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <HttpReferer />
   <Variables>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>Latest[ ]Version.*?(Beta.+?|Build.+?|\d.*?)[<|&]</Regex>
           <Url><placeholder name="Enter URL to be 'scraped'" /></Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>a href="([a-z]+://.*?\.(?:exe|7z|zip|zip2|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="Enter URL to be 'scraped'" /></Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <Category>[iNSERT CATEGORY HERE]</Category>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile>true</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 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}

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

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

 

 

I hope this helps Ketarin users reduce the amount of redundant manual entry of data as it has for me. Modify... improve and post YOUR improved version to share the knowledge!

 

 

CybTekSol

Link to comment
Share on other sites

<Regex>a href="([a-z]+://.*?\.(exe|7z|zip|zip2|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>

 

 

OMG... =D

 

1. So this is your starting point ? Yep, great idea !

2. I think you could decompose 2) to help others to start using placeholders, this feature is still undocumented... a simple example will do.

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.