Topic: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

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. wink
             
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>(?&lt;=Search[ ]Results.*?a href=")http://lifehacker.com/[\d]+/.+?(?=")</Regex>
            <Url>http://www.google.com/search?hl=en&amp;hl=en&amp;as_q=&amp;as_epq={LifeHackerPageName}&amp;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.*?)[?:\:|&lt;|&amp;]</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

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

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.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

floele wrote:

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 ?

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Yeah, he'd had to. But the text box would already be populated with that value. He sees your suggestion and can then decide wheter or not he likes that.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

floele wrote:

The text box would already be populated with that value...can then decide whether or not he likes that.

Cool... sounds GOOD to me!

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

floele wrote:

I'll add a new attribute for placeholders in Ketarin 1.0.3.

Not until 1.0.3 Flo? sad Does that mean you're going to jump from 1.0.2.215 to 1.0.3? smile

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

I like this ideia smile, what I do not like is the aditional placeholder pop-up that comes with it. sad
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

http://i43.tinypic.com/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. wink

Last edited by FranciscoR (2009-02-21 19:43:05)

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

@FranciscoR,
Not a bad idea from my viewpoint as long as the window would auto-size to accommodate descriptive text for the required input and not truncate it. FWIW, my viewpoint doesn't carry much weight in the final decision... that's all up to Flo obviously.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Yes and yes (as always). wink

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

I think that it migt look quite ugly if you have multiple placeholders with huge differences in length (especially with very long placeholder names).

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

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. smile

Last edited by FranciscoR (2009-02-22 17:35:33)

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

How else would you put all placeholders into one window?

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Not sure if I understand question... you mean from an implementation point of view ?

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Just the GUI point of view.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

OK, gimme some time to think about it.

P.S.
1. What text font are you using in placeholders and it's size ?
2. Are there specific placeholders names combinations you would like me to test ? Or I can use existing templates placeholders names...

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

1. I'm not using any specifc font. Usually, it will result in mS Sans Serif or Segoe UI, size 10.
2. Just check some of those already used in templates.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

OK. smile

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

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

http://i42.tinypic.com/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.

Last edited by FranciscoR (2009-02-22 20:16:42)

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

@FranciscoR,
I LIKE the above example and think it is VISUALLY APPEALING! I hope Flo feels the same as IMHO, it is a viable solution.

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

A "normal" template with just *1* placeholder (excluding name) would look like

http://i44.tinypic.com/ok2sm.jpg

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

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

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

CybTekSol wrote:

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. smile

Last edited by FranciscoR (2009-02-22 21:20:48)

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Hm...I'm a bit reluctant to duplicate those controls of the application dialog. But you made nice suggestions and I'll look into it smile

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

@floele: Thanks !
@CybTekSol: MAN, you do get excited with some simple Photoshop tweaks ! big_smile

Re: CybTekSol's LifeHacker.com Exclusive Downloads Generic template:

Flo, I promise I'll be quiet now but I got too excited last night. Better ? smile


http://i39.tinypic.com/vqtibn.jpg
http://i40.tinypic.com/2rd81g6.jpg

Last edited by FranciscoR (2009-02-23 19:58:23)