Questions tagged [krl]

KRL stands for Kinetic Rule Language. Use this tag for questions regarding KRL applications.

The Kinetic Rule Language was developed by Kynetx and runs on the Kinetic Event Architecture platform. KEA is a cloud-based platform for building real-time, context-aware applications that connect web services across multiple browsers and devices. It is the event layer that glues services like Twilio, Twitter, Google, Facebook, Amazon and others.

KRL is particularly useful for creating Evented systems. KRL is also used for writing Browser Applications. As such, KRL questions frequently overlap with questions about CSS, JavaScript, HTML, and jQuery.

Some places to start:

126 questions
3
votes
1 answer

KRL: Signing requests with HMAC_SHA1

I made a test suite for math:hmac_* KRL functions. I compare the KRL results with Python results. KRL gives me different results. code: https://gist.github.com/980788 results: http://ktest.heroku.com/a421x68 How can I get valid signatures from KRL?…
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
3
votes
1 answer

Is :TEXT a valid format for a KRL datasource?

The docs mention :XML, :JSON, and :HTML, but I have a URL that returns plain text. I'd like to write global { datasource tests_executed:TEXT <- "http://saucelabs.com/rest/v1/info/counter" } rule how_many_tests { pre { count =…
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
3
votes
1 answer

Picking an array of hashes from a hash

I have a hash coming back from an XML datasource that looks like this: {..., 'records' :{ 'record' :[ {'availability' :{'$t' :'available'}, ...}, {'availability' :{'$t' :'available'}, ...} ] } }; I'd like to get all the…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
3
votes
3 answers

Kynetx app not working when installed via KBX extension on Chrome

My app is loading an external javascript file with jQuery.getScript(). When I use the bookmarklet or an extension to start the app everything works fine. When the app is installed through KBX though inside Chrome with the KBX extension the included…
Loic Devaux
  • 316
  • 2
  • 9
3
votes
3 answers

Computing an HMAC-SHA signature

I'm writing a module for Amazon's SimpleDB. They require REST requests to be signed using HMAC-SHA algorithm. (Details here.) I'm told that there is a function to computer this signature, but I can't find it in the documentation. What is the…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
3
votes
1 answer

Kynetx twilio:place_call

According to the docs I should be able to have Twilio initiate a call for me with twilio:place_call( "3125551212", "7735551212", somewebhook); I can't seem to get it working quite right. Does the webhook need to be there, and if so what should it…
Jed
  • 703
  • 6
  • 13
3
votes
1 answer

dispatch of domain .* doesn't work in IE

We have an extension that needs to fire on every page the user loads. We have tried to accomplish this using domain ".*" in the dispatch block. While this works great in firefox and chrome, IE doesn't respect this at all. Is this a known issue or…
trumans1
  • 183
  • 2
  • 10
3
votes
3 answers

more than one defaction in the body?

All, can I run more than one defaction in the body of the rule? or can I only run one?
frosty
  • 21,036
  • 7
  • 52
  • 74
3
votes
1 answer

Building a hash inside a function

I have a function that returns a hash, given certain parameters: build_message = function(from, to, bcc, subject, tag, htmlbody, textbody, replyto) { message = {"From": from, "To": to, "Subject": subject, "HtmlBody":…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
3
votes
1 answer

Detecting a server-side re-direct in KRL

Our KRL extension has an interesting tracking problem. Basically we're one of many publishers of merchant links for CJ (commission junction). CJ requests that if another publisher appends afsrc=1 to their re-direct URL, no browser extension will…
trumans1
  • 183
  • 2
  • 10
3
votes
1 answer

How to set up predicates in KRL?

I have the following in my global block: test = defaction(){ if(5>10) then { notify("yes","yes"); } } Then I also have the following rule: rule tester { select when pageview ".*" test(); } I am expecting that the notify…
frosty
  • 21,036
  • 7
  • 52
  • 74
3
votes
1 answer

KRL: Parsing string as JSON

After using http:get(), I receive back a string from picking the "content" from the hash: response = http:get(webservice_url, {"key1": value1, "key2": value2}); json_resp = response.pick("$..content"); However, since json_resp is a string and not…
Steve Nay
  • 2,819
  • 1
  • 30
  • 41
3
votes
1 answer

Clear ent: variables after a certain amount of time as expired

I’m trying to clear certain ent: variables when a user first loads up their browser. I started with this example: select using ".*" setting () if ent:browserOpened == 0 within 4 hours then { notify("Hello!", "Welcome to your browser! Kynetx…
jon
  • 31
  • 1
3
votes
1 answer

When I use a KRL module do I get the deployed version?

Does importing a module get the deployed version in KRL? Suppose I want to use the development version, can I get that instead?
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
3
votes
1 answer

How do I slice an array in KRL

I have a bunch of HTML fragments in an array (thank you query()) but I only want to use the first five. I'm using foreach to inject the fragments into a page. If my array was [0,1,2,3,4,5,6,7,8] I would want just [0,1,2,3,4]. In Python I would use…
Randall Bohn
  • 2,597
  • 2
  • 16
  • 20
1 2
3
8 9