Questions tagged [krl]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
284 views

KRL: I want to use the Status Keys of the KRC4 Tablet to send outputs

i already have my code and if i am wrong please correct me. But the code isnt my problem ... i dont know where and how i use it in the KRC4 interface i thought a .src file would be enough inside of ...
Wurstfingr's user avatar
1 vote
1 answer
793 views

A strange error about the WAIT FOR statement in KUKA Robot Language(KRL)

When the program reaches "WAIT FOR"(server.src, line 11), the robot stops. And the "START" button must be pressed to continue running. What do I need to do to prevent the robot ...
John Tito's user avatar
2 votes
0 answers
70 views

KRL Search annotation rules for multiple domains, divs inserting for each domain whether domain matches or not

My KRL search annotation ruleset contains 4-5 rules that each do annotation based on the domain in the search results. I am getting good results, in that the annotations are pretty much when and where ...
Nathan's user avatar
  • 75
1 vote
0 answers
39 views

Proper way to format for multiple domains in KRL search annotation

I am configuring a rule in KRL to annotate based on results of 2+ distinct domains showing in the search results. The first domain works fine, but adding a 2nd or more breaks the rule. Sample of the ...
Nathan's user avatar
  • 75
0 votes
1 answer
59 views

Open and control new window in KRL/Kynetx

I want to open a new window by clicking on a button (which is injected via Kynetx), but I want this new window to run in the Kynetx sandbox enviornment. This is because the new window will have a ...
vishesh's user avatar
  • 2,003
2 votes
1 answer
58 views

Doing an "ORDER BY ... LIMIT ..." style query on a hash in KRL

Say I have a hash with a list of delivery drivers (for the classic flower shop scenario). Each driver has a rating and an event signal URL (ESL). I want to raise an event only to the top three drivers ...
Steve Nay's user avatar
  • 2,819
1 vote
1 answer
75 views

Raising events in KRL without using explicit

I'm writing an app that raises events, similar to how Phil Windley's personal data manager application works. However, if I try to use any event domain but explicit, the events don't get propagated. ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
59 views

adding mobile browser detection, rule selection, into a ruleset

I would like to add functionality to a ruleset that fires a distinct rule based on whether or not the browser is mobile or not. (one rule fires for a standard browser, a different rule fires for a ...
Nathan's user avatar
  • 75
2 votes
1 answer
95 views

How do I properly emit javascript in Kynetx rule?

I have code from my ad network that I am trying insert into an existing rule to call an ad from the server and place it into a div. The javascript code is given to me to, normally, to embed in my ...
Nathan's user avatar
  • 75
1 vote
1 answer
29 views

How do I force the rerun of the app's initial rule?

I have an app that has a login/logout functionality. Upon logout, I am clearing the entity variable. How do I force the app to rerun the initial rule and display the login form?
jshakespear's user avatar
2 votes
1 answer
148 views

How do I set entity variable with value within an emit

I'm retrieving a value within an emitted code block that I would like to set an entity variable to. This is what I'm trying to do: rule read_form { select when web submit "#loginForm" pre { ...
jshakespear's user avatar
1 vote
2 answers
84 views

Calling my own JavaScript functions

This problem only manifests itself when my app runs through the KBX. Running it in a bookmarklet works fine. I used to be able to do this, but it doesn't work any more. Here's what I have. There's an ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
90 views

KRL: Comparing two timestamps

I have two timestamps created with time:now() (one stored in an app variable from the past, one the current time). I need to find the difference between them (preferably in minutes). How do I do that? ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
32 views

KRL: Pragmatically access current ruleset id

How do I get the name of the current ruleset in a KRL rule? I find that I often write notify("a421x70","Your Message Here") with sticky = true; but when I copy the ruleset I have to go through and ...
Randall Bohn's user avatar
  • 2,597
2 votes
1 answer
36 views

How to tell if the result of pick() is a string

I'm using the Goodreads API through a datasource. I search with the ISBN number, and it returns results if it has any. Here's what it looks like if the book was found: <GoodreadsResponse> &...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
175 views

KRL: Getting the "location" header from an http:post()

I'm sending an HTTP POST request to a URL. It sends back a piece of information I need in the location header of the response. How do I get that header? I've tried the following code and it doesn't ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
188 views

KRL webhooks receiving JSON

I'm trying to set up a Webhook for Amazon SNS. SNS will send a JSON object to the webhook. Based on the KRL documentation I can get the event parameters using event:param('name'). That works for form ...
Randall Bohn's user avatar
  • 2,597
3 votes
1 answer
60 views

Kynetx and SOAP

I have been searching the web and Kynetx.com for any documetation or examples of how to use SOAP with KRL but have come up with nothing. Sadly the web services I am working with has a lot of SOAP ...
Reed's user avatar
  • 73
2 votes
1 answer
78 views

Why is the keyword 'then' required in KRL

When I'm writing a conditional action block in a KRL rule I always forget the 'then' keyword. Here is the correct syntax: rule with_conditions { select when pageview ".*" pre { cheese = "...
Randall Bohn's user avatar
  • 2,597
2 votes
1 answer
57 views

KRL module that is configured with API key

I'm writing a KRL module for an API. The API requires an access key, and that needs to be provided by the ruleset that calls my module. My module includes my access key that is used by the in-module ...
Randall Bohn's user avatar
  • 2,597
5 votes
3 answers
218 views

remove J and K key events on twitter.com

I built a browser extension that extends twitter.com. It opens a jQuery UI modal window, and has some text inputs. When I type in those inputs, it works, except for the J and K keys. Those keys are ...
frosty's user avatar
  • 21.1k
2 votes
0 answers
160 views

KRL convert XML to JSON

I'm working on a KRL module for S3. Each request has to be signed, and the signature covers a Date object which has to be within 15 minutes of the current time on AWS. The signature is sent as an '...
Randall Bohn's user avatar
  • 2,597
3 votes
1 answer
663 views

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/...
Randall Bohn's user avatar
  • 2,597
5 votes
1 answer
52 views

Raising an event in another ruleset

I'm collaborating on a large Kynetx app with another developer. To make it easier to split up the work, I'd like to have multiple rulesets so we can work on them separately without stepping on each ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
71 views

Raising an event after a keypress

Aaron Frost's TweetPlus app has a useful feature in which the tweet functionality of the app lies dormant until the user presses Ctrl+Alt+T. At that time, a notify box pops up in the upper right ...
Steve Nay's user avatar
  • 2,819
1 vote
1 answer
48 views

Assigning actions to a variable

In answering Aaron's recent question, I'd like to do something like the following: rule first_rule { select when pageview "exampley.com/\?name=(.*)" setting (username) pre { isjoe = ...
Steve Nay's user avatar
  • 2,819
1 vote
1 answer
42 views

ternary in postlude?

Can I do ternary in the postlude(s) the same way that I do them int he prelude? In other words have it fire off different calls depending on the say something was evaluated in the prelude?
frosty's user avatar
  • 21.1k
3 votes
1 answer
64 views

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 ...
Randall Bohn's user avatar
  • 2,597
2 votes
1 answer
85 views

How to formulate this select statement in KRL?

I'm trying to write a select statement that will run on www.google.com/blahblahblah but not www.google.com/readerblahblahblah Please help. I don't even know where to start.
frosty's user avatar
  • 21.1k
3 votes
1 answer
91 views

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'}...
Steve Nay's user avatar
  • 2,819
4 votes
1 answer
66 views

Generating a GUID/UUID in KRL

Is there a built-in function in KRL for generating a GUID of UUID (or something similar)?
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
56 views

KBX extension calling ruleset twice

I recently found a bug in TomatoFlix through the KBX. When the user is logged in on Netflix (different from the non-logged-in interface), the rating banner gets added twice: I added some emits to my ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
114 views

Using Json in KRL

I'm having trouble with parsing my Json, when i place the url in the browser i get this as a return {"token": "7xv6r32eay5n376", "secret": "589bc72ix7mowua"} So all i want to do is get that string and ...
Reed's user avatar
  • 73
4 votes
2 answers
115 views

Debugging with KBX extension : how to avoid having to deploy at every code modification?

I am currently debugging my apps so they can run with the KBX extension. KBX extension runs the last deployed version so everytime I change some code in the appbuilder I need to redeploy to see the ...
Loic Devaux's user avatar
4 votes
2 answers
138 views

Why aren't Kynetx browser apps available on addons.mozilla.org or chrome.google.com/extensions?

Is there any restriction on publishing Kynetx browser apps on addons.mozilla.org or chrome.google.com/extensions that explains why there are no kynetx apps available there ? When I search for "Kynetx"...
Loic Devaux's user avatar
-2 votes
1 answer
273 views

bug when function declaration is not followed by semicolon in emit of ruleset global section?

Here are two rulesets that illustrate a totally unexpected behavior. Is this a bug? Functions get executed even though they are not called anywhere or script breaks with a javascript error. The ...
Loic Devaux's user avatar
3 votes
3 answers
221 views

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 ...
Loic Devaux's user avatar
3 votes
3 answers
710 views

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 ...
Steve Nay's user avatar
  • 2,819
2 votes
1 answer
65 views

Can entity variables be functions?

Since functions and actions are first-class, is it possible for an entity variable to hold a function? Historically that was not the case; entity variables could only be flags, counters, trails, or ...
Steve Nay's user avatar
  • 2,819
-1 votes
1 answer
177 views

Firefox KRL extension on yahoo mail

It looks like the firefox extension might have an issue with the YUI 2.5.2 and 2.7 rich text editor. In the platform Rally when you see any text area, a lot of extra HTML is embedded into it. Rally ...
trumans1's user avatar
  • 183
3 votes
1 answer
85 views

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 ...
Jed's user avatar
  • 703
2 votes
2 answers
133 views

URI-encoding a string

I need to send a GET request. One of the parameters has URL query characters in it (e.g., ?, &, and =). How do I URI-encode that in KRL before sending the request? Here's the pseudocoded idea: ...
Steve Nay's user avatar
  • 2,819
4 votes
1 answer
71 views

Web analytics + KRL =?

What would happen if you used KRL to inject web analytics into various sites using a proxy end point? Is it possible to track multi-site usage with a Kynetx implementation?
drbabcock's user avatar
4 votes
1 answer
366 views

Responding to a webhook event with raw data

I'd like to write a ruleset that can respond to webhook events with raw data. The event might come in from a URL like the following: http://cs.kobj.net/blue/event/rest/echo/a163x85/?a163x85:...
Steve Nay's user avatar
  • 2,819
4 votes
1 answer
36 views

Can I promote an earlier version in the Kynetx Appbuilder?

I changed one of my applications (for April Fools) but I'd like to go back to the previous version and make it the development version. Is there any way to do this in Appbuilder, or do I have to ...
Randall Bohn's user avatar
  • 2,597
3 votes
1 answer
77 views

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 ...
trumans1's user avatar
  • 183
3 votes
3 answers
82 views

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's user avatar
  • 21.1k
4 votes
1 answer
69 views

KRL: using a defaction parameter in an emit block

I tried using a parameter in an emit block within a user defined action like this: my_action = defaction(css_class) { emit <| $K(css_class).append("<span>!!</span>"); |> } but ...
Randall Bohn's user avatar
  • 2,597
4 votes
1 answer
4k views

Using jsonPath looking for a string

I'm trying to use jsonPath and the pick function to determine if a rule needs to run or not based on the current domain. A simplified version of what I'm doing is here: global { dataset ...
trumans1's user avatar
  • 183
2 votes
1 answer
88 views

Ternary operator changing "true" to literal true

I'm trying to assign a string literal to a variable using a ternary operator with the following code in the pre block: texta = "approve"; textd = "deny"; aAction = texta eq "approve" => "true" | "...
Steve Nay's user avatar
  • 2,819