Jump to content
Ketarin forum

Ketarin FAQ


FranciscoR
 Share

Recommended Posts

Q: Is there a Ketarin tutorial?

See http://cdburnerxp.se/help/kb/20

Q: How do I define a path for jobs.db, so Ketarin can be used as portable application?

There are several ways to do this, see http://ketarin.org/forum/viewtopic.php?pid=2923

Q: How do I create a new job using a PAD file?

Insert the PAD file URL in the URL field, as shown bellow. Make sure that the developer keeps the PAD file up-to-date or application will not update.

2me6v6.png

Q: How do I capture an author name from PAD file?

Only version and download path are scraped by Ketarin, if you want to scrape any other available content - release date, author, etc. - you need to create additional custom variables, using (for instance) the regular expressions provided in the PAD Specification.

PAD Specification - http://www.asp-shareware.org/pad/spec/spec.php

Q: Are there any recommended databases of PAD files?

Not really. But you can use for instance


Some developers like NirSofer have their own PAD databases

Q: How do I create a new job using Online DB?

Go to Add new application > Import from online database. Type anything ('sql' in the example) and press search:

fypb3k.png

To import an application, select it and press 'Import'.

Q: Previously I've imported some broken applications from online DB, is there a way to prevent this?

Yes, right-click the selected application from online DB and select Properties.

wa1tg2.png

A new window (greyed) will pop-up. You can see exactly what you are about to import, if there's a version variable, if variables match, if application is updated, etc.

259e9n6.png

Q: How do I share an application?

Go to Edit > Advanced settings > Share this application online with others. Just put a checkmark there and press OK, database updates in a second (if the job doesn't exist already).

nqa6bn.png

Q: How do I create a new job using the default application setting?

Customize whatever you like and press 'Save as default'. The following new jobs will keep the saved settings.

2modz5t.png

For instance, I created a default new job using 'Test' as Category and '{target}\{category}\{appname}_{version}.{url:ext}' as target path / filename. When I click 'Add new application' both fields are populated as expected. All I have to do is to enter the remaining info (appname, urlpath, filehippoid, etc.).

ejiez5.png

Starting from version 1.0.8.285b1 there's another functional use for default application values as Ketarin uses those values (if saved) while importing applications from online DB - this doesn't apply to the category field.

Q: How do I create a new job using copy and paste?

This is as simple as to use Ctrl+C and Ctrl+V (or right-click and you will see the copy/paste options in the context menu). Another interesting use for copy/paste is to select a job, type Ctrl+C and paste that content into notepad (equivalent to File > Export Selected > Save as *.xml but limited to a single job). If you edit the resulting XML while keeping the GUID (top right of the XML) and import the job back into Ketarin, the original job is overwritten. If you edit XML and remove the GUID, a new job is created. The copy/paste procedure is also valid while pasting some XML here at the forum.

2w3dijd.png

Q: How do I create a new job using a Filehippo ID?

Copy and paste the URL of the application into the FileHippo ID text field.

awrymo.png

Using the Advanced Settings tab you can also choose whether or not to download 'Betas'. The 'Use default' setting is connected with the File > Settings > 'Avoid beta versions on Filehippo'. If the later is checked, 'Use default' will not download betas. If 'Avoid beta versions on Filehippo' is unchecked, you can use the 'Avoid' not to download betas.

2yyqefn.png

Q: What is and how do I use the HTTP Referer?

Some web servers verify from which page you are actually downloading the files. To prevent a 403 error from being returned, Ketarin allows you to spoof the referer and will automatically use the first variable's URL as referer, if no other referer is set. Note: this is usually not needed.

1zflt3t.png

Q: What is a template?

A template is an application minus some information. There is no GUID attached to it, so you can import it multiple times.

Q: How do I create a template?

If you want to share templates or create your own, you can export an existing application as template by choosing “Application Template” as output file type for File –> Export. After that, you can add placeholders manually to the exported XML. When a user imports an application template with placeholders, he will be asked to insert values for them.

Q: How do I insert placeholders?

Just add

 

<placeholder name="This will be shown to the user" />


to the exported XML. The user will only be prompted once for multiple placeholders with the same name. You can also add pre-selected values and options using

 

<placeholder name="This will be shown to the user" value="Suggested value" options="A|B|C"/>


Neither values or options are mandatory, so you can use one and not the other. Please refer to the 'Notes on XML Syntax' chapter for some recommendations on XML edits.

Q: How about some practical examples?

See the examples by CybtekSol in the following post http://ketarin.org/forum/viewtopic.php?id=311

Q: Is there a template repository available?

Yes, go to http://ketarin.org/forum/viewforum.php?id=5

Q: How do I import a template from the Forum?

1- Select the template code you wish to use and copy it;

2- Paste it into a Notepad with BOM (Notepad2, Notepad++, Pspad...);

3- Save as XML w/ UTF-8 encoding

4- Import template to Ketarin. Placeholders - if any - will pop-up:

vip2bl.png

Q: How do I test regexes?

For complex regular expressions, we recommend using Expresso, which is a nifty tool for building and testing .NET regular expressions. It's available at http://www.ultrapico.com/Expresso.htm. In alternative RegexBuddy http://www.regexbuddy.com/ is also very popular, and if you prefer something in the clouds you might also want to consider http://gskinner.com/RegExr/ (needs Adobe Flash Player installed).

Q: Is there a .NET regular expression reference?

Yep, go to http://msdn.microsoft.com/en-us/library/az24scfc.aspx

Q: What other recommended resources about Regular Expressions are there?


Q: I'm having problems importing XML, what can I do?

It depends, but in general you need to respect the XML syntax, a good summary is available at http://www.w3schools.com/xml/xml_syntax.asp

Q: Can I validate a XML prior to import?

Yes, go to http://validator.w3.org/#validate-by-input

Q: Can I extract data from sqlite DB?

Yes, using a third-party Sqlite util you can run SQL queries to view or extract data from Ketarin SQLite database.

Q: I don't know how to use SQLite syntax.

SQLite understands most of the standard SQL language, for starters you can use the W3Schools tutorial, http://www.w3schools.com/sql/sql_intro.asp. But remember some features are omited http://sqlite.org/omitted.html. For instance, this is the SQL I've used to extract all different paths:

SELECT DISTINCT targetpath
FROM jobs
ORDER BY targetpath ASC

Another example, using an SQL function to do some quick stats in http://ketarin.org/forum/viewtopic.php?pid=2874#p2874.
select variablename, count(*)
from variables
group by variablename
order by count(*) desc

Q: Is there a reference for commands I can use?

The basic reference is available at http://technet.microsoft.com/en-us/library/bb491071.aspx. You can also download a file to use localy from http://www.microsoft.com/downloads/details.aspx?familyid=5fb255ff-72da-4b08-a504-1b10266cf72a&displaylang=en. Also, refer to your third-party documentation for aditional command line options.

Q: How about some practical examples on how to use commands?

For instance, using dir and tree to create a change log and a list of updates at http://ketarin.org/forum/viewtopic.php?id=93. Or, using 7-zip command line to unpack compressed files at http://ketarin.org/forum/viewtopic.php?id=204. CybtekSol as also included several alternative commands in his placeholder examples, http://ketarin.org/forum/viewtopic.php?id=311.

Q: I need to combine several commands, is there a way to do this?

Yes, you need to use 'windows conjunctions', see http://commandwindows.com/command1.htm

nprjfm.png

Wildcards (*,?) are also generally usefull, see http://www.ahuka.com/dos/lesson11.html

Q: I read something about using Environment variables...?

Environment variables are a set of dynamic named values. The variables can be used both in scripts and on the Ketarin command line. See the following article http://en.wikipedia.org/wiki/Environment_variable for more details.

dbp4qo.png

Q: Can I use Ketarin built-in variables with commands?

Yes, for instance

{rem} {7z}7z x {file} -o{a}{appname}\ -y

(note: {a} and {rem} are global variables, {file} and {appname} are built-in variables)

Another example,

2qthgjr.png

(note: {shared} is a globalvar, 'd:\shared')

Q: Are there some examples of built-in functions?

Please refer to http://ketarin.org/forum/viewtopic.php?id=83 and to http://ketarin.org/forum/viewtopic.php?pid=2285#p2285 for some examples. In http://ketarin.org/forum/viewtopic.php?pid=2740#p2740 some examples of "directory" and "filename" functions are provided.

Q: I'm having trouble with some function characters like "}" or ":".

You can use "}" or ":" within function parameters if you escape them with "\}". With "\\" you can use "\", so "\\\}" results in "\}".

Q: Can I use buil-in variables and functions with regex?

Yep. Given a 'normal' regex
SyncBackSE V(\d+[\.\d]+)\s+?(?:<)

You can use a global variable {v1}=\d+[\.\d]+
SyncBackSE V({v1})\s+?(?:<)

... you can use a variable (more details here)
http://({durl1}(?:\d.*?)?)\.zip(?=")

... or a function (more details here)
http://({durl:regex:(ghisler\.fileburst\.com/.+?)(\d.*?)?\.zip:1}(?:\d.*?)?)\.zip(?=")

Q: What is POST data and how can I use it?

See the following thread and follow the links provided http://ketarin.org/forum/viewtopic.php?id=295

Q: Are there any independent reviews available?

Edited by floele
Link to comment
Share on other sites

Just my Ketarin 'flavor', no doubt there is also a Floele, CybTekSol, Stalker (...) Ketarin 'flavors'. ;) I've been testing some regexes optimizations, maybe i'll update tutorial with that because now window seems a lot more responsive with long and somewhat complex regexes. Basically you have to avoid 'lazy dots', backtracking whenever you can and be certain that your regex growth is linear. Unfortunatelly Expresso 'stopwatch bechmarks' are no good to test this and i'm not aware of a free regex debugger that achives this. :(

Edited by FranciscoR
Link to comment
Share on other sites

As always, good job.

 

Please include any of the stuff which was discussed here. I will leave the pdf on its current location for a couple more weeks. If any of you would like to have the originating word document, just drop me a line.

 

Despite my well meant intentions, I have not been able to update the start of 'my' 'tutorial' recently as I have accepted a new job and spend most of my time in Dubai now. It just makes more sense to me if the tutorial is handled by someone more regular then I am.

 

So long and thanks for all the fish,

R

Link to comment
Share on other sites

Hi FranciscoR and dutchclimber, I am new to Ketarin and really appreciate your efforts!

Currently I am trying to learn regular expressions and I got stuck with the following:

Webpage: http://www.cpuid.com/cpuz.php

Extracted code:

[...]<b>CPU-Z 1.51 .zip</b>[...]

 

With the following expression I am able to extract the string "1.51" both from Ketarin and Expresso:

(?<=CPU-Z\s)[0-9.]+(?=\s.zip)

 

But this one only works in Expresso:

(?<=CPU-Z\s).+(?=\s.zip)

 

Could someone explain to me why the second expression doesn't work with Ketarin?

 

Thanks!

Link to comment
Share on other sites

Hi, I can't help you direclty on your question (I don't have Expresso and don't know the code of Ketarin).

However, for cpu-z I use CPU-Z\s(\d+(?:\.\d+)+) and it works fine so far.

Anyway, welcome :)

 

PS: Also, I you have a new question, please create a new post for it, it makes more sense.

Edited by andreone
Link to comment
Share on other sites

You have the string

 

<b>CPU-Z 1.51 setup</b>

before

 

<b>CPU-Z 1.51 .zip</b>

 

so the regex will match everything from that \s until '.zip' -> error. Unless you paste a big portion of that string into Expresso, you will not be able to reproduce this behaviour. Try to use

 

(?<=CPU-Z\s)([0-9.]+?)(?=\s\.zip)

 

or

 

(?<=CPU-Z\s)([0-9.]+?)(?=\s(?:setup|\.zip))

 

 

PS. I haven't seen it before, but the expression suggested by andreone works as well. You choose. ;)

Edited by FranciscoR
Link to comment
Share on other sites

@andreone:

Thanks for the info and the welcome, I'll create a new topic next time. =)

 

@FranciscoR:

Unless you paste a big portion of that string into Expresso, you will not be able to reproduce this behaviour.

That's what I don't get, I pasted the whole html code in Expresso...

 

I'll use the first expression I posted, it's similar to yours but without the "?".

 

Thanks for answering. ;)

Link to comment
Share on other sites

I have witnessed numerous anomalies between the processing of regex in Ketarin vs. Expresso when developing regexs for templates. I suspect there are slight differences in the .NET implementation/interpretation that could be the culprit. I have been wrong before though. LOL

Link to comment
Share on other sites

  • 4 years later...
  • 1 month later...

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.