CybTekSol Posted January 20, 2009 Report Share Posted January 20, 2009 My LATEST Universal SnapFiles.com template: ****PLEASE TEST it and provide suggestions for improvement if possible! ****NOTE: This template uses the application's DOWNLOAD page URL (NOT the information page URL)! In other words, go to the application's info page URL at SnapFiles in your web browser and click the 'Download' button, cancel the download and copy the URL from your browser's address bar for THAT page. 1) There are two user defined global variables used, download_url={download_url} (used as an alternative to {url}) and root_folder=YOUR Download Destination ROOT Folder (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>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><title>.*?(\d[.].*?)[ ].*?</title></Regex> <Url><placeholder name="Application Download Page URL from SnapFiles" /></Url> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>download_url</string> </key> <value> <UrlVariable> <VariableType>RegularExpression</VariableType> <Regex>url=(.*?)"</Regex> <Url><placeholder name="Application Download Page URL from SnapFiles" /></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> 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) Enter the information needed as requested as a result of the 'placeholder' prompts... it will ask for the application's DOWNLOAD page URL (NOT the 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) I hope this helps someone... CybTekSol Link to comment Share on other sites More sharing options...
nma Posted January 22, 2009 Report Share Posted January 22, 2009 (edited) Hi! Since I've one SnapFiles Template too I might as well share it. <?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><title>.*?(\d[.].*?)[ ]Free.*?</title></Regex> <Url>http://www.snapfiles.com/download/dl{SnapFilesId}.html</Url> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>download_url</string> </key> <value> <UrlVariable> <VariableType>RegularExpression</VariableType> <Regex>(?<=<meta http-equiv="refresh" content="4; url=).+?(?="\s/>)</Regex> <Url>http://www.snapfiles.com/download/dl{SnapFilesId}.html</Url> <Name>download_url</Name> </UrlVariable> </value> </item> <item> <key> <string>SnapFilesId</string> </key> <value> <UrlVariable> <VariableType>Textual</VariableType> <Regex /> <Url>http://www.snapfiles.com/download/dlspad.html</Url> <TextualContent><placeholder name="SnapFiles Application Id" /></TextualContent> <Name>SnapFilesId</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>[iNSERT DOWNLOAD TARGET HERE]</TargetPath> <FixedDownloadUrl>{download_url}</FixedDownloadUrl> <Name>[iNSERT APPLICATION NAME HERE]</Name> </ApplicationJob> </Jobs> Get "SnapFiles Application Id" from the DOWNLOAD page url as follows: SnapFilesId = hxxp://www.snapfiles.com/download/dlspad.html SnapFilesId = hxxp://www.snapfiles.com/download/dlanyflvplayer.html Cheers! Edited January 22, 2009 by nma Link to comment Share on other sites More sharing options...
CybTekSol Posted January 22, 2009 Author Report Share Posted January 22, 2009 Get "SnapFiles Application Id" from the DOWNLOAD page url as follows: SnapFilesId = hxxp://www.snapfiles.com/download/dlspad.html SnapFilesId = hxxp://www.snapfiles.com/download/dlanyflvplayer.html I like the idea of using the 'SnapFilesId'... for some reason this was not obvious to me... I have modified the SnapFiles template that I will use most often as a result of this. Thanks! I added a 'placeholder' for the application name, changed the order of the variables so that 'SnapFilesId' is the first listed, added my custom 'TargetPath' variables and removed the residual URL for dlspad.html left over in the template. BTW, the 'SnapFilesId' appears to always be the same as the initial application's info page, for example: [snapFilesId = hxxp://www.snapfiles.com/get/spad.html] or [snapFilesId = hxxp://www.snapfiles.com/reviews/PSPad_Editor/spad.html] which makes it even easier. LONG LIVE Ketarin (and Florian)! Link to comment Share on other sites More sharing options...
FranciscoR Posted January 23, 2009 Report Share Posted January 23, 2009 Both templates seem to be working fine, thanks ! And it's excellent to be able to customize templates ! =) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now