Goal: Capture information contained in the URL that a Kynetx app is run on
ruleset a60x490 {
meta {
name "capture-in-select-statement"
description <<
capture-in-select-statement
>>
author "Mike Grace"
logging on
}
rule get_user_id_on_user_detail_page {
select when pageview "http://stackoverflow\.com/users/([0-9]*)/" setting (userId)
{
notify("User ID found!",userId) with sticky = true;
}
}
}
- 12 Selection expression uses a regular expression capture group to grab the user ID of a StackOverflow user when app is run on a user detail page
App run on http://stackoverflow.com/users/117068/mike-grace with a bookmarklet

Get the bookmarklet to try it out yourself!
Gratuitous day 10 crazy face
