Jump to content
Ketarin forum

CybTekSol's LifeHacker.com Exclusive Downloads Generic template:


CybTekSol
 Share

Recommended Posts

My LifeHacker.com Exclusive Downloads Generic template:

 

This template uses Google's search engine to compensate for URL changes at LifeHacker.

 

NOTE: This is a 'generic' template which I use for LifeHacker.com Exclusive

Downloads when they are 'featured' on their site on any given day.

It may require a small tweak or two each time due to their inconsistencies

in page layout, but, it will give to something to play with. ;)

 

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-Apps].

 

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>{find}</HttpReferer>
   <Variables>
     <item>
       <key>
         <string>LifeHackerPageName</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>Textual</VariableType>
           <Regex />
           <TextualContent><placeholder name="LifeHacker.com Page Name from URL [Example: belvedere-automates-your-self+cleaning-pc]" /></TextualContent>
           <Name>LifeHackerPageName</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>find</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>(?<=Search[ ]Results.*?a href=")http://lifehacker.com/[\d]+/.+?(?=")</Regex>
           <Url>http://www.google.com/search?hl=en&hl=en&as_q=&as_epq={LifeHackerPageName}&as_sitesearch=lifehacker.com</Url>
           <Name>find</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>Version.*?(Beta.+?Build.+?|Beta.+?|Build.+?|\d.*?)[?:\:|<|&]</Regex>
           <Url>{find}</Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>[a-z]+[ ]only:.*?a href="([a-z]+://.*?\.[a-z]{3})"</Regex>
           <Url>{find}</Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <Category>LifeHacker-Exclusive-Apps</Category>
   <SourceType>FixedUrl</SourceType>
   <PreviousLocation />
   <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 LifeHacker.com Page Name from URL

[Example: belvedere-automates-your-self+cleaning-pc]

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!

 

 

Enjoy!

 

 

CybTekSol

Link to comment
Share on other sites

I'll add a new attribute for placeholders in Ketarin 1.0.3. Then you can do the following:

 

<TargetPath><placeholder name="Target path" value="{root_folder}\{category}\{appname:replace: :_}_v{version:replace: :_}.{url:ext}" /></TargetPath>

 

Seems most user friendly to me.

Link to comment
Share on other sites

I'll add a new attribute for placeholders in Ketarin 1.0.3. Then you can do the following:

 

<TargetPath><placeholder name="Target path" value="{root_folder}\{category}\{appname:replace: :_}_v{version:replace: :_}.{url:ext}" /></TargetPath>

 

Seems most user friendly to me.

I'm confused... the user would have to input this each time or could this be generated from a custom global variable preset by the user under 'Settings' from {Target path}=whatever ?

Link to comment
Share on other sites

I like this ideia =), what I do not like is the aditional placeholder pop-up that comes with it. =(

Pop-ups are annoying, and we already have a lot. A pop-up for this placeholder... a pop-up for that placeholder... a pop-up for the other placeholder... and final pop-up for target placeholder (as suggested). I think a much better way for user to handle placeholders, is to have a single pop-up window with all placeholders in it, e.g., some sort of placeholder info window, like

 

2h3zsy8.jpg

 

P.S. Sorry for the unhauthorized Photoshop tweak Flo, the font is also not correct but I think you will get idea/request. ONE SINGLE pop-up for ALL placeholders requests. ;)

Edited by FranciscoR
Link to comment
Share on other sites

THAT graphical design doesn't work obviously. I just picked the pre-existing placeholder window and apply a simple tweak, with the single purpose to comunicate ideia. I don't like the looks either. If it helps some graphical design alternatives, I will be happy to provide them. But very long placeholder names is something we can control... CybTekSol names are usually larger than myne... anyway, whathever you say. I would like to have that. =)

Edited by FranciscoR
Link to comment
Share on other sites

Example using CybTekSol Firefox (3 extra-extra-large placeholders =)):

 

9u9cgo.jpg

 

Note: I don't have your fonts installed, so I am using Arial 11. The point here is that even with extra-extra-large placeholders (=CybTekSol) this can be done. The window is based on the Edit window on GUI, difference is height and width would be variable (with exception of the last 3 fields, Application Name, Category and Save to file/folder, where height would be fixed). A base width could be the one you're using for Edit window, that would grow as large as placeholder name would require.

Edited by FranciscoR
Link to comment
Share on other sites

And maybe the 'Category' could be pre-populated with 'New'. Then the 'Save to file' or 'Save in folder' selection could be determined from how the majority of the apps within your personal Jobs.db are configured, and likewise the <targetpath> pre-populated in the same manner? If this is possible... MAN... templates would really rock!

 

Addendum: Of course, if it is a new Jods.db, it could default to the template author's 'placeholder' input for population...

Link to comment
Share on other sites

Then the 'Save to file' or 'Save in folder' selection could be determined from how the majority of the apps within your personal Jobs.db are configured, and likewise the <targetpath> pre-populated in the same manner?

Like a drop-down menu pre-populated with existing data OR empty with a new DB ? Fine by me. =)

Edited by FranciscoR
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.