Topic: A template without steroids: Portablefreeware.com

<?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>ID</string>
        </key>
        <value>
          <UrlVariable>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent><placeholder name="Portablefreeware ID" /></TextualContent>
            <Name>ID</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <VariableType>RegularExpression</VariableType>
            <Regex>/icon.gif"&gt;&lt;/a&gt;.*?&lt;p&gt;.*?([\d]+?.[\d]+?\sBeta|\d+?.Beta|Beta.+?|Build.+?|[\d]+-[\d]+-[\d]+|[\d.]+|[\d]+)[&amp;|&lt;]</Regex>
            <Url>http://www.portablefreeware.com/?id={ID}</Url>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>ref</string>
        </key>
        <value>
          <UrlVariable>
            <VariableType>RegularExpression</VariableType>
            <Regex>download.php.(?:d|i)d=</Regex>
            <Url>http://www.portablefreeware.com/?id={ID}</Url>
            <Name>ref</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <Category>Test</Category>
    <SourceType>FixedUrl</SourceType>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated xsi:nil="true" />
    <TargetPath>{target}\{category}\{appname}_{version}.{url:ext}</TargetPath>
    <FixedDownloadUrl>http://www.portablefreeware.com/{ref}{ID}</FixedDownloadUrl>
    <Name><placeholder name="Application Name" /></Name>
  </ApplicationJob>
</Jobs>

Usage:
1. Import XML into Ketarin;
2. Go to http://www.portablefreeware.com/ and locate the app you want to download. Click on Permalink;
3. Copy-paste ?id= value in the first Information box;
4. Copy-paste app name in the second Information box;
5. Customize all the rest at will.

Example:
2. Permalink: http://www.portablefreeware.com/?id=1245
3. Portablefreeware ID: 1245

http://i39.tinypic.com/2m6wbpc.png

4. Application name: SysExporter 

http://i43.tinypic.com/vcwcnb.png

Note: it doesn't work when there's no direct download link (neither Ketarin); other than that, it's a speed demon ! smile


@CybTekSol: sorry, it's not complicated. wink
@floele: It would be nice and time-saving to insert only the ?id= value, maybe we could add a PortableFreeware_ID box below Filehippo_ID ? In the future...? big_smile (this is not needed anymore)

Last edited by FranciscoR (2009-01-23 21:12:21)

Re: A template without steroids: Portablefreeware.com

Maybe, yes. But not for now. Why global variables?

Re: A template without steroids: Portablefreeware.com

floele wrote:

Why global variables?

An alternative is a non-global variable with textual content. Do you like it better ? I think I do. wink

Re: A template without steroids: Portablefreeware.com

Fixed.

Re: A template without steroids: Portablefreeware.com

Then again, you can also make use of placeholders wink

Re: A template without steroids: Portablefreeware.com

Perfetto !!! wink

Re: A template without steroids: Portablefreeware.com

@FranciscoR,
GOOD job... I like it! big_smile Oh... the power of the 'placeholder' implementation and ingenuity!

Re: A template without steroids: Portablefreeware.com

@CybTekSol,
Thanks ! I am also surprised, I had no idea I could do such things. Florian's assitance is really precious ! wink BTW, I learned how to use the placeholders with your Majorgeeks template (but I'm still scratching my head on how you do it smile). Thank you and keep the good job ! wink

Re: A template without steroids: Portablefreeware.com

I think template is now ready for prime-time. Enjoy ! smile

Re: A template without steroids: Portablefreeware.com

Try App ID 159 & 1388... 159 is the one my regex has trouble with on my revision. It's very difficult to make an 100% 'error free' template but don't give up. I haven't quite achieved it yet. It might be an elusive goal. wink

Re: A template without steroids: Portablefreeware.com

Are you using my latest build, updated today ? No problems here with 159. The SIV error is not obvious for me, it should work. I'll have a look, but even downloading from firefox gives me a 27 sec delay. In the mean time you can try 1245, 1314, 159, 191, 1398, 775... but thanks for feedback !=)

Re: A template without steroids: Portablefreeware.com

Problem with SIV is version, other than that it works perfect. I've just downloaded it. I'll fix this. smile

Last edited by FranciscoR (2009-01-23 00:20:33)

Re: A template without steroids: Portablefreeware.com

FranciscoR wrote:

Problem with SIV is version, other than that it works perfect. I've just downloaded it. I'll fix this. smile

Yes, I was using the version you posted today... I should have stated that it was the version that was the problem... forgive me. wink

Re: A template without steroids: Portablefreeware.com

I have just uploaded a revison, now SIV should work. The SIW problem is rather different - and unique in this site -, although file is downloaded as it should, I'm not sure how to solve it. All other apps have a version, but SIW doesn't; this causes Ketarin to grab everything up to "end of selection" as "version". How would you solve this ? Please, no need to apologize, and thanks again ! wink

Re: A template without steroids: Portablefreeware.com

CybTekSol wrote:
FranciscoR wrote:

Problem with SIV is version, other than that it works perfect. I've just downloaded it. I'll fix this. smile

Yes, I was using the version you posted today... I should have stated that it was the version that was the problem... forgive me. wink

I mean the variable "version", it's because of that double "V", they are just too close, damn. wink But now it showld work.

Re: A template without steroids: Portablefreeware.com

@FranciscoR,
I chose to use a regular expression to 'scrape' the version info from PortableFreeware... it has worked with every App ID I have tested it with so far.

The regex is:

/icon.gif"></a>.*?<p>.*?(Beta.+?|Build.+?|[\d]+-[\d]+-[\d]+|[\d.]+|[\d]+)[&|<]

Test it if you wish. wink

Re: A template without steroids: Portablefreeware.com

CybTekSol wrote:

@FranciscoR,
I chose to use a regular expression to 'scrape' the version info from PortableFreeware... it has worked with every App ID I have tested it with so far.

The regex is:

/icon.gif"></a>.*?<p>.*?(Beta.+?|Build.+?|[\d]+-[\d]+-[\d]+|[\d.]+|[\d]+)[&|<]

Test it if you wish. wink

Try to grab version (not to download) from 271 and 509. And the "." after Beta causes Ketarin to get metacharacters and other strange stuff. I changed regex wink just a bit:

/icon.gif"></a>.*?<p>.*?([\d]+?.[\d]+?\sBeta|\d+?.Beta|Beta.+?|Build.+?|[\d]+-[\d]+-[\d]+|[\d.]+|[\d]+)[&|<]

I think I'm starting to like regex, I re-uploaded template. smile

Btw, there are several downloads with daily quota, so Ketarin retrieves an error. Try to download with Firefox (?) and you will get this message: Daily download quota exceeded. Please try again tomorrow.

Re: A template without steroids: Portablefreeware.com

@FranciscoR,
Thanks... I'll make the change to mine. I believe regex is the way to go... I'm using it exclusively in my templates. The 'Daily Quota' issue is a pain and the only way around it is to find another source. wink