After playing around a bit with Ketarin, I wanted a simple way to download the latest versions offered by SourceForge. I know there's many templates available, but either they're too difficult for me to understand (e.g. FranciscoR's), required use of external tools (e.g. Gozi's), or didn't work for me in its presented form (e.g. Shawn's). I'm not knocking any of these templates - what they've done shows the time and brainpower invested into making such great templates - but they just aren't for me (at this present time!).
Mine is simple in terms of design as well required user input. I've used Shawn's template as a base for this one.
When accessing the 'Files' page, SourceForge presents the user with a download link to the newest version, seemingly assisted by the browser's User-Agent value. This template emulates IE8 on Windows to return a download link preferred for Windows. Also, due to no consistency regarding versioning on SF, this template sets the {version} variable to the text presented in the link e.g. KeePass-2.13-Setup.exe. Personally I don't think it's a huge deal, as any updates would be determined by a change in this value since last check. As long as SF keeps this consistent, there shouldn't be a problem.
Due of this template's simplicity, several drawbacks arise:
you don't get to choose the specific file type or version to download -- only what SF deems the latest available, and in the format it deems you would want
as {version} is not just the traditional version number, it's not ideal to use this field in the resulting filename -- I suggest using {url:basefile}.{url:ext} in this instance.
the desired SF mirror needs to be manually selected/entered -- a list of which can be found here, and its default value can be changed within the template.
If these aren't deal-breakers for you, I suggest giving this template a go.
This is my first attempt at Ketarin templates so there's going to be bugs or ways to do things better. Your thoughts are appreciated!
<?xml version='1.0' encoding='utf-8'?>
<Jobs>
<ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name><placeholder name="Application Name" value="" /></Name>
<Category><placeholder name="Application Category" value="Unassigned" /></Category>
<SourceType>FixedUrl</SourceType>
<DeletePreviousFile><placeholder name="Delete Previous Version?" value="true" options="false|true" /></DeletePreviousFile>
<Enabled>true</Enabled>
<FileHippoId />
<WebsiteUrl>http://sourceforge.net/projects/{sftag}/</WebsiteUrl>
<IgnoreFileInformation>false</IgnoreFileInformation>
<DownloadBeta>Default</DownloadBeta>
<CheckForUpdatesOnly>false</CheckForUpdatesOnly>
<VariableChangeIndicator>{version}</VariableChangeIndicator>
<CanBeShared>true</CanBeShared>
<ShareApplication>false</ShareApplication>
<ExclusiveDownload>false</ExclusiveDownload>
<HttpReferer>http://sourceforge.net/projects/{sftag}/files/{filenamepath}/download</HttpReferer>
<Variables>
<item>
<key>
<string>sftag</string>
</key>
<value>
<UrlVariable>
<RegexRightToLeft>false</RegexRightToLeft>
<VariableType>Textual</VariableType>
<TextualContent><placeholder name="SF application tag" value="" /></TextualContent>
<Name>sftag</Name>
</UrlVariable>
</value>
</item>
<item>
<key>
<string>version</string>
</key>
<value>
<UrlVariable>
<RegexRightToLeft>false</RegexRightToLeft>
<VariableType>RegularExpression</VariableType>
<Regex><span>Download (.+?) \([\d\.]{1,7} (?:M|K|G|T)?B\)</span></Regex>
<Url>http://sourceforge.net/projects/{sftag}/files/</Url>
<Name>version</Name>
</UrlVariable>
</value>
</item>
<item>
<key>
<string>sfmirror</string>
</key>
<value>
<UrlVariable>
<RegexRightToLeft>false</RegexRightToLeft>
<VariableType>Textual</VariableType>
<TextualContent><placeholder name="'Short name' of desired SourceForge mirror" value="internode" /></TextualContent>
<Name>sfmirror</Name>
</UrlVariable>
</value>
</item>
<item>
<key>
<string>filenamepath</string>
</key>
<value>
<UrlVariable>
<RegexRightToLeft>false</RegexRightToLeft>
<VariableType>RegularExpression</VariableType>
<Regex>"http://sourceforge.net/projects/{sftag}/files/([^"'=]+?)/download"</Regex>
<Url>http://sourceforge.net/projects/{sftag}/files/</Url>
<Name>filenamepath</Name>
</UrlVariable>
</value>
</item>
</Variables>
<TargetPath>.\{category}\{url:basefile}.{url:ext}</TargetPath>
<FixedDownloadUrl>http://{sfmirror}.dl.sourceforge.net/project/{sftag}/{filenamepath}</FixedDownloadUrl>
<UserAgent>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)</UserAgent>
</ApplicationJob>
</Jobs>
Thanks.