Gozi Posted October 3, 2010 Report Share Posted October 3, 2010 (edited) Lets explain it in examples. We want to download Unetbootin from SF http://sourceforge.net/projects/unetbootin/ For this project (and other projects too) the "/files/latest"-link will always redirect you to the latest Release: http://sourceforge.net/projects/unetbootin/files/latest Take this link and you can extract the direct link in ketarin, extract the version and what ever you need or like ;-) BUT..... DO NOT use referer! Or SF will redirect you directly to the binary and Ketarin will show an error! Example version 1.0 <?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" Guid="b77325ef-6d86-416a-a608-2f9ca34952b9"> <WebsiteUrl /> <UserAgent /> <UserNotes /> <LastFileSize>4603904</LastFileSize> <LastFileDate>2010-09-29T07:11:50+02:00</LastFileDate> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator /> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>false</ExclusiveDownload> <HttpReferer /> <SetupInstructions /> <Variables> <item> <key> <string>url</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>StartEnd</VariableType> <Regex /> <Url>http://sourceforge.net/projects/unetbootin/files/latest</Url> <StartText>ResponseUri: </StartText> <EndText>Connection:</EndText> <Name>url</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand></ExecuteCommand> <ExecutePreCommand></ExecutePreCommand> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <Category> Tools</Category> <SourceType>FixedUrl</SourceType> <PreviousLocation>y:\software\sourceforge_{version}.exe</PreviousLocation> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2010-10-03T19:56:53.6226+02:00</LastUpdated> <TargetPath>{2DIR}\{appname}_{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{url}</FixedDownloadUrl> <Name>sourceforge</Name> </ApplicationJob> </Jobs> Edited October 3, 2010 by Gozi Link to comment Share on other sites More sharing options...
shawn Posted October 6, 2010 Report Share Posted October 6, 2010 Do you know of a way to consume a generic version number from these URLs? Link to comment Share on other sites More sharing options...
Gozi Posted October 6, 2010 Author Report Share Posted October 6, 2010 Quick and dirty again! I use the directory name as version number. A good example is Inkscape portable http://sourceforge.net/projects/inkscape/files/inkscape/0.48/Inkscape_0.48.paf.exe In most cases it´s equal to version number. How ever, for me is that unique enough to be a good version number for the dirty way. Take a look on my 2 templates in the online database (inkscape & inkscape portable). There I use the newest directory for actual release and the extension to get the desired version (portable or exe or zip) and to extract the real version number. Here the portable one <?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" Guid="13a5aa69-9146-4eb0-97c3-bc76ab904cd3"> <SourceTemplate><![CDATA[]]></SourceTemplate> <WebsiteUrl /> <UserAgent /> <UserNotes /> <LastFileSize>36080209</LastFileSize> <LastFileDate>2010-10-01T20:47:55.3002</LastFileDate> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate>2010-08-30T17:16:39</DownloadDate> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator /> <CanBeShared>false</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>false</ExclusiveDownload> <HttpReferer /> <SetupInstructions /> <Variables> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>{SFextension}">InkscapePortable_([^\s]*).paf.exe</a></Regex> <Url>{SFdlurl}/{SFuser}/{SFproject}/{getDIR}</Url> <StartText>Programm</font></td> <td width="0"><font face="Verdana" size="2"></StartText> <EndText> </font></td></EndText> <TextualContent>{getDIR}</TextualContent> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>SFuser</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>inkscape</TextualContent> <Name>SFuser</Name> </UrlVariable> </value> </item> <item> <key> <string>getDIR</string> </key> <value> <UrlVariable> <RegexRightToLeft>true</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>a href="([^\s]*)/"></Regex> <Url>{SFdlurl}/{SFuser}/{SFproject}/{SFsort}</Url> <StartText> <body></StartText> <EndText></body></EndText> <TextualContent /> <Name>getDIR</Name> </UrlVariable> </value> </item> <item> <key> <string>SFproject</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>inkscape</TextualContent> <Name>SFproject</Name> </UrlVariable> </value> </item> <item> <key> <string>SFdlurl</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>http://ignum.dl.sourceforge.net/project</TextualContent> <Name>SFdlurl</Name> </UrlVariable> </value> </item> <item> <key> <string>SFdirs</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>StartEnd</VariableType> <Regex /> <Url>{SFdlurl}/{SFuser}/{SFproject}/{SFsort}</Url> <StartText><body></StartText> <EndText></body></EndText> <Name>SFdirs</Name> </UrlVariable> </value> </item> <item> <key> <string>SFfilename</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>{SFextension}">([^\s]*)</a></Regex> <Url>{SFdlurl}/{SFuser}/{SFproject}/{getDIR}</Url> <Name>SFfilename</Name> </UrlVariable> </value> </item> <item> <key> <string>url</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <Url>{SFdlurl}/{SFuser}/{SFproject}/{getDIR}/{SFfilename}</Url> <TextualContent>{SFdlurl}/{SFuser}/{SFproject}/{getDIR}/{SFfilename}</TextualContent> <Name>url</Name> </UrlVariable> </value> </item> <item> <key> <string>SFextension</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>.paf.exe</TextualContent> <Name>SFextension</Name> </UrlVariable> </value> </item> <item> <key> <string>SFsort</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>?C=M;O=A</TextualContent> <Name>SFsort</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand /> <ExecutePreCommand /> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <Category>App</Category> <SourceType>FixedUrl</SourceType> <PreviousLocation>q:\software\InkscapePortable_0.48.exe</PreviousLocation> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2010-10-01T20:47:55.3002</LastUpdated> <TargetPath>{2DIR}\{appname}_{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{url}</FixedDownloadUrl> <Name>InkscapePortable</Name> </ApplicationJob> </Jobs> Link to comment Share on other sites More sharing options...
shawn Posted October 6, 2010 Report Share Posted October 6, 2010 Unfortunately, that method won't work for me on many of my SF sources. Link to comment Share on other sites More sharing options...
Gozi Posted October 7, 2010 Author Report Share Posted October 7, 2010 For example? I´m on a new template for SF and would need some cases. Link to comment Share on other sites More sharing options...
shawn Posted October 12, 2010 Report Share Posted October 12, 2010 Anything that uses recursive subfolders, like portableapps or winmerge. Link to comment Share on other sites More sharing options...
Gozi Posted October 12, 2010 Author Report Share Posted October 12, 2010 It should work with my submitted template above (Inkscape Portable), http://sourceforge.net/projects/winmerge/files/stable/ (stable subdirectory for winmerge) and a little adjustment. Theres a Regex for getting the newest subdirectory, Cd to the Dir an to download the file with the right extension. With your expertise in Regex , you´ll be able to get the latest release with the wanted extension easily. I´m actually working on a new template with better support for SubDir and a little Wiki with some hints. The first Beta is working. Maybe its ready till weekend. 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