Jump to content
Ketarin forum

CybTekSol's Universal MajorGeeks.com Template (32-bit Apps ONLY)


CybTekSol
 Share

Recommended Posts

My LATEST Universal MajorGeeks.com (32-bit Apps Only) template:

 

1) There are three user defined global variables used, redir1={redir1} (short for re-direct 1)

and 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>Avoid</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <VariableChangeIndicator>{version}</VariableChangeIndicator>
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <HttpReferer />
   <Variables>
     <item>
       <key>
         <string>version</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex>((?:\d+?\.\d+?.*?|\w+?\s\d\d\,\s\d{4})(?=</title>)|(?<=Date:.*?>)(?:\d{4}-\d{2}-\d{2}).*?(?=<))</Regex>
           <Url><placeholder name="Application Info Page URL from Major Geeks" /></Url>
           <Name>version</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>redir1</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex><A href="(downloadget.php\?id=[\d]+&file=(?:10|9)&[a-z]+=\w+)"></Regex>
           <Url><placeholder name="Application Info Page URL from Major Geeks" /></Url>
           <Name>redir1</Name>
         </UrlVariable>
       </value>
     </item>
     <item>
       <key>
         <string>download_url</string>
       </key>
       <value>
         <UrlVariable>
           <VariableType>RegularExpression</VariableType>
           <Regex><META HTTP-EQUIV="Refresh".*?URL=(.*?)"></Regex>
           <Url>http://majorgeeks.com/{redir1}</Url>
           <Name>download_url</Name>
         </UrlVariable>
       </value>
     </item>
   </Variables>
   <ExecuteCommand />
   <Category>[iNSERT CATEGORY HERE]</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>

Note** I use PSPad to edit my XML exports... Florian suggests NotePad2 if my memory

serves me correctly... both are freeware and I like both. NotePad2 is lighter and

quicker in my tests, so I will probably switch. ;)

 

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 application's information page URL and the application's name

c) Modify the Category to your preferences

d) Change the 'Advanced Settings' to your preferences

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

MAKE ADJUSTMENTS to them as necessary!

 

 

****NOTE:

 

IF YOU WISH TO CREATE A TEMPLATE from one of YOUR XML exports:

 

1)It is important that the Guid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" string be

removed from the XML export to use it as a template, otherwise you'll just keep

overwriting the previously saved application entry that was created using the

imported template

2) The <DownloadDate> line must be changed to <DownloadDate xsi:nil="true" />

3) The <LastUpdated> line must be changed to <LastUpdated xsi:nil="true" />

4) Remove the entire <PreviousLocation> line or replace it with <PreviousLocation />

5) Create 'placeholder' entries as needed (see THIS thread)

 

****ADDENDUM:

 

For 32-bit Applications ONLY! The servers that are most reliable for me (Servers 10 & 9) are selected with the file=(?:10|9) portion of the {redir1} regex. These can be adjusted to use the servers that are most reliable for you.

 

****CREDITS:

 

MANY THANKS to FranciscoR for dramatically improving the {version} scrape which FranciscoR has graciously allowed me to use in this updated version of my template! It appears that FranciscoR's MajorGeeks.com template will handle BOTH 32-bit and 64-bit apps from their site... so you may want to give it a try!

 

I hope this helps someone...

 

CybTekSol

Edited by CybTekSol
Link to comment
Share on other sites

Like I said earlier I strongly advise against using {url} as your variable due to the problems with {url:ext} and alike.

Can you clarify this for me as I'm not experiencing any problems with this. Am I missing something or just slightly confused (has happened before)? ;)

Link to comment
Share on other sites

Yes, for {url:ext}. Basically {url} must point to the actual file URL, not what is scraped. So if you scrape something which redirects someplace else into{url} you'll get some useless link in the variable and {url:ext} with {url:basefile} won't work. Actually I don't think implementing {extension} is even needed. Just don't allow people to override some variables.

Basically the rule of the thumb with variables should be not to override built-in variables unless necessary (like {version}) and try to give them as descriptive names as possible. Copy-paste will save you all the hassle of typing them down and you'll thank yourself later on for not being lazy and naming your variable {application_id} instead of {appid} for example. I really don't see what's so magic in {url} that people prefer using it instead of {link} for example.

Link to comment
Share on other sites

Yes, for {url:ext}. Basically {url} must point to the actual file URL, not what is scraped. So if you scrape something which redirects someplace else into{url} you'll get some useless link in the variable and {url:ext} with {url:basefile} won't work. Actually I don't think implementing {extension} is even needed. Just don't allow people to override some variables.

Basically the rule of the thumb with variables should be not to override built-in variables unless necessary (like {version}) and try to give them as descriptive names as possible. Copy-paste will save you all the hassle of typing them down and you'll thank yourself later on for not being lazy and naming your variable {application_id} instead of {appid} for example. I really don't see what's so magic in {url} that people prefer using it instead of {link} for example.

I just finished a global search and replace of my XML exports replacing occurrences of {url} and associated tags with {download_url}... hope this solves the issue. Thanks!

Link to comment
Share on other sites

I just finished a global search and replace of my XML exports replacing occurrences of {url} and associated tags with {download_url}... hope this solves the issue. Thanks!

You're welcome. Just don't forget to do it in the code above :P

Stalker,

I've modified the code above to reflect my latest changes... and provided a 'disclaimer' since Florian found a flaw in my regex... :o

Link to comment
Share on other sites

Hm...the template does not seem to work with downloads like this one:

http://majorgeeks.com/downloadget.php?id=4050&file=5&evp=e5903555dfd0b3afc2b650d62bcb309f

 

It redirects to an HTML link and not to a fileX-server. I guess you'll have to adjust the regex a bit...

Florian... now I feel like a failure. :( A solution to this escapes me at the moment, so I've included a 'disclaimer' in the LATEST revision above that takes advantage of the 'placeholder' feature you implemented! If only I were as gifted. ;)

Link to comment
Share on other sites

Is this your latest template ? =) Doesn't seem to work for me:

 

http://majorgeeks.com/download4191.html

 

==================================================

Application : ccleaner_MG

Error : The operation has timed out (http://files6.majorgeeks.com/files/2c12328aab48072aee9c07cf4442b238/drives/ccsetup215_slim.exe)

==================================================

 

http://majorgeeks.com/CCleaner_Portable_d5735.html

 

==================================================

Application : ccleaner_MG2

Error : The operation has timed out (http://files6.majorgeeks.com/files/2c12328aab48072aee9c07cf4442b238/drives/ccsetup215.zip)

==================================================

 

Not sure if I'm saying anything new though...

Link to comment
Share on other sites

@FranciscoR,

This is an issue with their servers... when this happens to me, I simply adjust the regex for the {redir1} variable by removing one of the [\d] entries in file=[\d][\d] to use a different server. As a matter of fact, I've changed my template to file=[\d] as the server scraped by file=[\d][\d] is less reliable. Like I said in another post, a 100% 'error-free' template may be an elusive goal. On the other hand, I believe universal templates, even my generic one for miscellaneous sites make life much more productive with Ketarin. ;)

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.