Gozi Posted October 1, 2010 Report Share Posted October 1, 2010 (edited) Hi all, this is my first template and i´m new on ketarin. So hints and tips are welcome ;-) Requirements: - You need WGET for Windows. Get it on Softpedia and place the wget.exe in the same DIR of Ketarin. - The variable {2DIR} is my custom directory, where the files are stored. Set, change or delete it as you wish under Ketarin. How it works: - First of all you´ll be asked for the URL of your desired Tool on Softpedia. Copy&paste the url of the main page of the tool on Softpedia. - Enter the desired name for your App Rest will done with Regex: - Finding the Linkpage for Download - Finding the Screenshot, defining the name and extension - Getting the "direct link" of redirection page - Parsing the short description As known, Sourceforge redirects are a bit tricky and this template will not work if Softpedia use those links. Unter "Commands" you´ll find some code. - WGET loads the first screenshot and saves it unter <Appname>.<original extension from server>. - ECHO will create a new file with the content of short description for your app The extension is .info and it´s a txt file. Feel free to rename the extension for your needs. Have fun Gozi Version 1.9.4 (working ONLY with > 1.5 beta 5) For Ketarin 1.4 please use version 1.91! Whats new: Little help instructions inside Added template version number. So you´ll see which template version was used Added License parsing from Softpedia <?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"> <WebsiteUrl><placeholder name="Enter the Softopedia url" /></WebsiteUrl> <UserNotes><placeholder name="User Notes" variable="SetUserNotes"/></UserNotes> <LastFileSize>106681</LastFileSize> <LastFileDate>2010-09-26T23:50:38.7502</LastFileDate> <UserAgent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)</UserAgent> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator>version</VariableChangeIndicator> <VariableChangeIndicator /> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>false</ExclusiveDownload> <HttpReferer>{WebsiteUrl}</HttpReferer> <Variables> <item> <key> <string>TemplateVersion</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>1.9.4</TextualContent> <Name>TemplateVersion</Name> </UrlVariable> </value> </item> <item> <key> <string>TemplateAutor</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Gozi</TextualContent> <Name>TemplateAutor</Name> </UrlVariable> </value> </item> <item> <key> <string>AutorsEditoral</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Version 1.9.4 by Gozi Requirements: Ketarin version > 1.5 b6 You need WGET for Windows. Get it on Softpedia and place the wget.exe in the same DIR of Ketarin. How it works: First of all you´ll be asked for the URL of your desired Tool on Softpedia. Copy and paste the url of the main page of the tool on Softpedia. Rest will done with Regex: This Template supports auto naming. Finding the Linkpage for Download Finding the Screenshot, defining the name and extension Getting the "direct link" of redirection page Parsing the short description Unter "Commands" you´ll find some code. WGET loads the first screenshot and saves it unter Appname.original extension from server. ECHO will create a new file with the content of short description for your app. The extension is .info and it´s a txt file. Feel free to rename the extension for your needs. Whats new: Parsing license from Sofpedia Site </TextualContent> <Name>AutorsEditoral</Name> </UrlVariable> </value> </item> <item> <key> <string>InfoPage</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{property:WebsiteUrl}</TextualContent> <Name>InfoPage</Name> </UrlVariable> </value> </item> <item> <key> <string>License</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>href="http://www.softpedia.com/user/licensing.*?>([\S]*)</a></Regex> <Url>{InfoPage}</Url> <TextualContent>{property:WebsiteUrl}</TextualContent> <Name>License</Name> </UrlVariable> </value> </item> <item> <key> <string>APPName</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>5px;">([\s\w]*) description<</Regex> <Url>{InfoPage}</Url> <Name>APPName</Name> </UrlVariable> </value> </item> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><title>Download {APPName} ([\s\d\w.]*) Free</Regex> <Url>{InfoPage}</Url> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>GetDownloadLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><a href="([^\s]*)" title="Download </Regex> <Url>{InfoPage}</Url> <Name>GetDownloadLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetFileLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><a href="([^\s]*)" title="Download </Regex> <Url>{GetDownloadLink}</Url> <Name>GetFileLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetRedirect</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex> If it doesn't, please <a href="([\d\s\w\S]*)" rel</Regex> <Url>{GetFileLink}</Url> <Name>GetRedirect</Name> </UrlVariable> </value> </item> <item> <key> <string>GetSSLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>href="http://www.softpedia.com/progScreenshots/([^\s]*)"</Regex> <Url>{InfoPage}</Url> <Name>GetSSLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetSSImage</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>href="http://www.softpedia.com/screenshots/([^\s]*)"</Regex> <Url>http://www.softpedia.com/progScreenshots/{GetSSLink}</Url> <Name>GetSSImage</Name> </UrlVariable> </value> </item> <item> <key> <string>ImageLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>http://www.softpedia.com/screenshots/{GetSSImage}</TextualContent> <Name>ImageLink</Name> </UrlVariable> </value> </item> <item> <key> <string>SetUserNotes</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>class="KonaBody"> ([\w\s\d\W]*) \[</Regex> <Url>{GetDownloadLink}</Url> <Name>SetUserNotes</Name> </UrlVariable> </value> </item> <item> <key> <string>url</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{GetRedirect}</TextualContent> <Name>url</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand>wget {ImageLink} -O "{2DIR}\{appname}.{GetSSImage:split:.:1}" echo "{SetUserNotes}">"{2DIR}\{appname}.info" echo "License: {License}">>"{2DIR}\{appname}.info"</ExecuteCommand> <ExecutePreCommand></ExecutePreCommand> <Category> Tools</Category> <SourceType>FixedUrl</SourceType> <PreviousLocation>q:\Software\WGET_1.5.3.1.zip</PreviousLocation> <DeletePreviousFile>false</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2010-09-26T23:50:38.7502</LastUpdated> <TargetPath>{2DIR}\{appname}_{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{url}</FixedDownloadUrl> <Name><placeholder name="Enter desired application name" variable="APPName"/></Name> </ApplicationJob> </Jobs> Version 1.9.2 (working ONLY with 1.5 beta 6) With the new beta you´ll be able to set variables in your placeholder. Read more:http://ketarin.canneverbe.com/forum/viewtopic.php?pid=4140#p4140 THX to Floele for this great function :-) Auto naming: Replace the last Placeholder with following code, and Ketarin will name your application with the variable "APPName". For more details take a look into my template. <Name><placeholder name="Enter desired application name" variable="APPName"/></Name> Auto description: Replace the UserNotes-line with following Code, and Ketarin will store the short description. <UserNotes><placeholder name="User Notes" variable="SetUserNotes"/></UserNotes> Version 1.9.1 - Better parsing for Application Name - No question for updating the template - Setting Website variable now working (Ketarin 1.5 b5) <?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"> <WebsiteUrl><placeholder name="Enter the Softopedia url" /></WebsiteUrl> <UserNotes></UserNotes> <LastFileSize>106681</LastFileSize> <LastFileDate>2010-09-26T23:50:38.7502</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>http://www.softpedia.com/</HttpReferer> <Variables> <item> <key> <string>InfoPage</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{property:WebsiteUrl}</TextualContent> <Name>InfoPage</Name> </UrlVariable> </value> </item> <item> <key> <string>APPName</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>">([\S^/]+) description<</Regex> <Url>{InfoPage}</Url> <Name>APPName</Name> </UrlVariable> </value> </item> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><title>Download {APPName} ([\s\d\w.]*) Free</Regex> <Url>{InfoPage}</Url> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>GetDownloadLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><a href="([^\s]*)" title="Download </Regex> <Url>{InfoPage}</Url> <Name>GetDownloadLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetFileLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex><a href="([^\s]*)" title="Download </Regex> <Url>{GetDownloadLink}</Url> <Name>GetFileLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetRedirect</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex> If it doesn't, please <a href="([\d\s\w\S]*)" rel</Regex> <Url>{GetFileLink}</Url> <Name>GetRedirect</Name> </UrlVariable> </value> </item> <item> <key> <string>GetSSLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>href="http://www.softpedia.com/progScreenshots/([^\s]*)"</Regex> <Url>{InfoPage}</Url> <Name>GetSSLink</Name> </UrlVariable> </value> </item> <item> <key> <string>GetSSImage</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>href="http://www.softpedia.com/screenshots/([^\s]*)"</Regex> <Url>http://www.softpedia.com/progScreenshots/{GetSSLink}</Url> <Name>GetSSImage</Name> </UrlVariable> </value> </item> <item> <key> <string>ImageLink</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>http://www.softpedia.com/screenshots/{GetSSImage}</TextualContent> <Name>ImageLink</Name> </UrlVariable> </value> </item> <item> <key> <string>SetUserNotes</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>class="KonaBody"> ([\w\s\d\W]*) \[</Regex> <Url>{GetDownloadLink}</Url> <Name>SetUserNotes</Name> </UrlVariable> </value> </item> <item> <key> <string>url</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>{GetRedirect}</TextualContent> <Name>url</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand>wget {ImageLink} -O "{2DIR}\{appname}.{GetSSImage:split:.:1}" echo "{SetUserNotes}">"{2DIR}\{appname}.info"</ExecuteCommand> <ExecutePreCommand></ExecutePreCommand> <Category> Tools</Category> <SourceType>FixedUrl</SourceType> <PreviousLocation>q:\Software\WGET_1.5.3.1.zip</PreviousLocation> <DeletePreviousFile>false</DeletePreviousFile> <Enabled>true</Enabled> <FileHippoId /> <LastUpdated>2010-09-26T23:50:38.7502</LastUpdated> <TargetPath>{2DIR}\{appname}_{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{url}</FixedDownloadUrl> <Name><placeholder name="Enter desired application name" /></Name> </ApplicationJob> </Jobs> Edited October 11, 2010 by Gozi Link to comment Share on other sites More sharing options...
floele Posted October 1, 2010 Report Share Posted October 1, 2010 Annoying question to update the template, when you´ve created some apps with the template (got no idea) My fault rather. Need to find a solution for that. Link to comment Share on other sites More sharing options...
Gozi Posted October 1, 2010 Author Report Share Posted October 1, 2010 Hi Floele, now it works (bug in Ketarin 1.5 b4?). I´ve just deleted the guid and now it seems to work. Link to comment Share on other sites More sharing options...
floele Posted October 1, 2010 Report Share Posted October 1, 2010 Yep, but that should not be required. Or rather, using the GUID is recommended. 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