Created
May 16, 2010 23:16
-
-
Save MikeGrace/403249 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruleset a60x226 { | |
meta { | |
name "array inside an array" | |
description << | |
for devex question | |
>> | |
author "Mike Grace" | |
logging on | |
} | |
dispatch { } | |
global { | |
exampleHash = { | |
"articles" : [ | |
{ | |
"title" : "Not sure what to title this", | |
"thumbs" : [ | |
{ "url" : "http://geek.michaelgrace.org/MikeGrace.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/is.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/a.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/fun.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/guy.jpg" } | |
] | |
}, | |
{ | |
"title" : "Not going to change the images for this one", | |
"thumbs" : [ | |
{ "url" : "http://geek.michaelgrace.org/MikeGrace.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/is.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/a.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/fun.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/guy.jpg" } | |
] | |
}, | |
{ | |
"title" : "Isn't Devex great?!", | |
"thumbs" : [ | |
{ "url" : "http://geek.michaelgrace.org/MikeGrace.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/is.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/a.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/fun.jpg" }, | |
{ "url" : "http://geek.michaelgrace.org/guy.jpg" } | |
] | |
} | |
] | |
} | |
} | |
rule first_rule is active { | |
select using ".*" setting () | |
foreach exampleHash.pick("$.articles") setting (article) | |
foreach article.pick("$.thumbs") setting (thumb) | |
pre { | |
title = article.pick("$.title"); | |
thumbnail = thumb.pick("$.url"); | |
} | |
notify(title,thumbnail) with width = 300 and sticky = true; | |
// end of foreach that iterates for each thumbnail in article | |
// end of foreach that iterates over each article | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment