Created
February 12, 2010 04:38
-
-
Save mathfur/302299 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
// Ubiquityで使う | |
// すべての検索結果について、,url,title,docの組をとってくる | |
gglob: function(key){ | |
var results = []; | |
$.ajax({ | |
url: "http://www.google.co.jp/search", | |
data: {q: key}, | |
async: false, | |
success: function(data,textStatus){ | |
// サーチごとに | |
Utils.log(">>[success][start] data:"); | |
Utils.log(data.slice(0,100)); | |
$("h3 a",data).slice(0,10).each(function(){ | |
// 検索結果ごとに | |
Utils.log(">[each][start] $(this):"); | |
Utils.log($(this).html().slice(0,100)); | |
var url = $(this).attr("href"); | |
var title = $(this).html(); | |
$.ajax({ | |
url: url, | |
async: false, | |
success: function(resp,textStatus_){ | |
results.push({ | |
url: url, | |
title: title, | |
doc: $(resp) | |
}); | |
} | |
}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment