Created
March 22, 2011 20:59
-
-
Save TelegramSam/882045 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 a8x133 { | |
meta { | |
name "StackOverflow" | |
description << | |
>> | |
author "Sam" | |
logging on | |
} | |
dispatch { | |
} | |
global { | |
so_qpm = function(){ | |
apiurl = "http://api.stackoverflow.com/1.1/stats"; | |
apiresponse = http:get(apiurl); | |
fullstats = apiresponse.pick("content").decode(); | |
fullstats.pick("$..questions_per_minute"); | |
}; | |
double_rainbow = defaction(a){ | |
//pre | |
b = a + 2; | |
//actions | |
{ | |
notify("StackOverflow", "Questions per minute: #{a}") with sticky = true; | |
notify("Second Notify", "Questions plus two: #{b}") with sticky = true; | |
} | |
}; | |
} | |
rule first_rule { | |
select when pageview ".*" setting () | |
pre { | |
qpm = so_qpm(); | |
} | |
{ | |
double_rainbow(qpm); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment