Jump to content
Ketarin forum

MAPJe71

Members
  • Posts

    37
  • Joined

  • Last visited

Posts posted by MAPJe71

  1. The PowerShell script I use to split an applications-export XML file into individual XML files:

    $inFile = $args[0]
    $directory = Split-Path -Parent $MyInvocation.MyCommand.Path
    $ketarinExport = [xml](Get-Content $inFile)
    foreach ($job in $ketarinExport.Jobs.ApplicationJob)
    {
        [xml]$xmlDoc = New-Object system.Xml.XmlDocument
        $xmlDoc.LoadXml("<?xml version=`"1.0`" encoding=`"utf-8`"?><Jobs/>")
        $xmlNode = $xmlDoc.ImportNode($job, $true)
        $null = $xmlDoc.LastChild.AppendChild($xmlNode)
    
        $outFile = Join-Path $directory ($job.Name + ".xml")
        $xmlDoc.Save($outFile)
    }
    
  2. FYI

     

    I have been able to retrieve a direct-download URL using Ketarin.

     

    It requires two request-verification tokens. The first token can be found in a cookie. You have to retrieve the token from the cookie because it changes regulary and is somehow connected to the second token. Haven't verfied it yet but I guess its value changes daily. The second token can be retrieved from the applications page. This token changes on every get-request of that page.

     

    I was not able to retrieve the first token from the cookie using Ketarin. I used Fiddler to get the token value and added it as a constant (i.e. textual content variable) in Ketarin to retrieve the direct-download URL.

  3. Selecting 'C# script' as a command shows the following info ...

    /*
      Enter a custom C# script here. C# is case sensitive.
      "app" references the current application.
      Example:
      MessageBox.Show(app.Name);
      
      = Notable methods =
      app.PreviousLocation
        Corresponds to the variable {file}
    
      app.Variables.ReplaceAllInString("Any {text} with variables.")
        Replaces all known variables in a given string.
        Example: string new = app.Variables.ReplaceAllInString("{file}")
    
      return;
        Exits the script.
    
      Abort("Error text");
        Exits the script with a given error.
    */
    

    I could not find any additional info here in the forum or on the Wiki.

    So I was wondering if anyone knows more about the API in additional to the aforementioned 'notable methods' and

    could point me in the right direction.

     

    Thanx, Menno

  4. CodePlex requirs two request-verification-tokens to retrieve the redirect-URL to download the actual file.

    One token can be retrieved from the applicable HTML-page. The other token can be retrieved from a cookie.

     

    However, AFAIK Ketarin does not support reading cookies.

     

    In order to be able to use Ketarin to download from CodePlex I hereby request the feature to read cookies.

    Preferable in such a way that it is possible to store the data in a variable (e.g. "Content from Cookie").

  5. I'll add this to the next version. If someone gives me a better regex for getting the version number from a site like this

     

    http://filehippo.com...d_firefox/tech/

     

    than this regex <code>((?<=\>Title:\<.*?\s)(?:\(?\d+?\.\d+?.*?)(?=\</td\>)|(?:[a-z]+?\s\d{1,2},\s\d{4}))</code>

     

    I'll also add it to the beta.

     

    Well I guess you have several RegEx options for that particular URL ...

    - Parse the title of the window:

    (?<=\<title\>Download\D+?)\d{1,5}\.\d{1,5}(?:\.\d{1,5}(?:\.\d{1,5})?(?:\sRC\d)?|\sBeta\s\d{1,2}|b\d{1,2})?(?=\D)

    - Parse a meta tag:

    (?<=meta itemprop=['"]softwareVersion['"] content=['"]\D*?)\d{1,5}\.\d{1,5}(?:\.\d{1,5}(?:\.\d{1,5})?(?:\sRC\d)?|\sBeta\s\d{1,2}|b\d{1,2})?(?=['"])

    - Parse the download table on the far right on the page:

    (?<=dlboxinner.+?Version\D*?)\d{1,5}\.\d{1,5}(?:\.\d{1,5}(?:\.\d{1,5})?(?:\sRC\d)?|\sBeta\s\d{1,2}|b\d{1,2})?(?=\D)

     

    Regards,

    Menno

  6. Hi,

     

    I defined a textual variable which uses the regexreplace function to rearrange some values e.g.

     

    {mytemp:regexreplace:(\d{1,2})\s(\d{1,2}),\s(\d{2,4}):$3-$1-$2}

     

    It uses the '{...}'-quantifier but this conflicts with the Ketarin-variable-definition.

    I re-defined the variable to

     

    {mytemp:regexreplace:(\d+)\s(\d+),\s(\d+):$3-$1-$2}

     

    but was wondering if there is another solution e.g. 'escaping' the curly brackets (tried '\', did not work).

     

    Thanks,

     

    Menno

×
×
  • 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.