Skip to content

Instantly share code, notes, and snippets.

@DenisMir
Created March 5, 2011 17:28
Show Gist options
  • Save DenisMir/b04320d864f07a1e54d6 to your computer and use it in GitHub Desktop.
Save DenisMir/b04320d864f07a1e54d6 to your computer and use it in GitHub Desktop.
google search
function(){
var res = [];
$("li.g").each(function(){
var linkNode, descNode, link, text, desc;
linkNode = $(this).find("a.l");
descNode = $(this).find("div.s")
link = linkNode.attr("href");
text = linkNode.text();
desc = descNode.remove("span.f").text();
if(link && text && desc){
res.push({text: text, link: link, desc: desc});
}
});
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment