Questions tagged [krl]
KRL stands for Kinetic Rule Language. Use this tag for questions regarding KRL applications.
126
questions
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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?
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 {
...
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 ...
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?
...
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 ...
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>
&...
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 ...
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 ...
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 ...
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 = "...
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 ...
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 ...
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 '...
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/...
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 ...
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 ...
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 = ...
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?
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 ...
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.
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'}...
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)?
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 ...
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 ...
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 ...
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"...
-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 ...
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 ...
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 ...
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 ...
-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 ...
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 ...
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:
...
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?
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:...
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 ...
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 ...
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?
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 ...
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 ...
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" | "...