-
Notifications
You must be signed in to change notification settings - Fork 1
/
lab5.krl
55 lines (49 loc) · 1.11 KB
/
lab5.krl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ruleset foursquare {
meta {
name "lab 3"
author "Jacob Wright"
logging off
use module a169x701 alias CloudRain
use module a41x186 alias SquareTag
}
rule process_fs_checkin {
select when foursquare checkin
pre {
}
{
raise explicit event 'checkin_occured';
}
}
rule init {
select when web cloudAppSelected
pre {
my_html = <<
<div id=foursquare><b>Checkin for Jake Wright</b> <br /></div>
>>;
}
{
SquareTag:inject_styling();
CloudRain:createLoadPanel("Foursquare", {}, my_html);
}
}
rule display_checkin {
select when explicit checkin_occured
pre {
name = ent:venue_name;
my_city = ent:city;
my_shout = ent:shout;
my_created = ent:created;
my_html = <<
<ul>
<li>Venue name: #{name}</li>
<li>City: #{my_city}</li>
<li>Shout: #{my_shout}</li>
<li>Created At: #{my_created}</li>
</ul>
>>;
}
{
replace_inner("#foursquare", my_html);
}
}
}