Skip to content

Instantly share code, notes, and snippets.

@958
Created September 1, 2008 09:56
Show Gist options
  • Save 958/8287 to your computer and use it in GitHub Desktop.
Save 958/8287 to your computer and use it in GitHub Desktop.
[Ubiquity]google-history-search
makeSearchCommand({
name: "google-history",
url: "http://www.google.com/history/find?q={QUERY}",
icon: "http://www.google.com/favicon.ico",
description: "Searches google history for your words.",
preview: function(prev, index) {
var query = index.text;
prev.innerHTML = "Searching for...";
var url = "http://www.google.com/history/find";
var params = {q: query, output: 'rss'};
jQuery.get(url, params, function(feed) {
var listHtml = "<ol>";
jQuery("item", feed).slice(0, 10).each(function(index, item) {
var text = jQuery("title", item).text();
var link = jQuery("link", item).text();
listHtml +=
"<li>" +
"<a href='" + link + "'>" + text + "</a>" +
"</li>";
});
listHtml += "</ol>";
jQuery(prev).html(listHtml);
}, 'xml');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment