Created
August 17, 2010 04:09
-
-
Save edorcutt/528425 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 a169x74 { | |
meta { | |
name "annotate-google-query" | |
description << | |
Annotate Google search results | |
http://devex.kynetx.com/questions/537/accessing-dom-elements-from-kynetx-server-environment | |
>> | |
author "Ed Orcutt http://edorcutt.org" | |
logging on | |
} | |
dispatch { | |
domain "google.com" | |
} | |
global { | |
datasource google:HTML <- "http://www.google.com/search?"; | |
} | |
rule annotate_google is active { | |
select when pageview "http://www.google.com/.*search.*(?:&|\?)(?:p|q)=(.*?)(:?&|$)" setting (keywords) | |
foreach (datasource:google("q="+keywords).query("div#ires ol li.g h3.r a.l")) setting (item) | |
pre { | |
MyURL = item.replace(/.*(http[\w|\/|:|\?|&|\.|\-|_|=]*).*\n/,"$1"); | |
} | |
notify("MyURL: ", MyURL) with sticky = true; | |
// Make an interesting Kynetx library call here with MyURL | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment