Aller ! ma petit contribution 😃
voici un script pour Ubiquity pour pouvoir faire des recherches sur ubuntu-fr.org
Commande :
ubuntu <search term> : Rechercher sur le site ubuntu-fr.org.
ubuntu-doc <search term> : Recherche dans la documentation de ubuntu-fr.org.
ubuntu-forum <search term> : Recherche dans le forum de ubuntu-fr.org.
function innerHTMLData( pblock, data, template, nb )
{
var results = data.responseData.results.splice( 0, nb );
pblock.innerHTML = CmdUtils.renderTemplate( {file:template}, {results:results} );
}
function previewGoogle(pblock, motCle, recherche, nb)
{
var pTemplate = "Recherche <b>"+motCle+"</b> ...";
var pData = {query: recherche};
pblock.innerHTML = CmdUtils.renderTemplate(pTemplate);
var url = "http://ajax.googleapis.com/ajax/services/search/web";
var params = { v: "1.0", q: recherche };
jQuery.get( url,
params,
function(data){ innerHTMLData(pblock, data, "google-search.html", nb); },
"json");
}
makeSearchCommand
({
name: "ubuntu",
description: "Rechercher sur le site ubuntu-fr.org.",
author: { name: "Ekinoks" },
license: "LGPL",
url: "http://www.google.fr/search?hl=fr&q={QUERY}+site:ubuntu-fr.org",
icon: "http://www.ubuntu-fr.org/favicon.ico",
preview:
function(pblock, directObject)
{
previewGoogle(pblock, directObject.text, directObject.text+"+site:ubuntu-fr.org", 3);
}
});
makeSearchCommand
({
name: "ubuntu-doc",
description: "Recherche dans la documentation de ubuntu-fr.org.",
author: { name: "Ekinoks" },
license: "LGPL",
url: "http://www.google.fr/search?hl=fr&q={QUERY}+site:doc.ubuntu-fr.org",
icon: "http://www.ubuntu-fr.org/favicon.ico",
preview:
function(pblock, directObject)
{
previewGoogle(pblock, directObject.text, directObject.text+"+site:doc.ubuntu-fr.org", 3);
}
});
makeSearchCommand
({
name: "ubuntu-forum",
description: "Recherche dans le forum de ubuntu-fr.org.",
author: { name: "Ekinoks" },
license: "LGPL",
url: "http://www.google.fr/search?hl=fr&q={QUERY}+site:forum.ubuntu-fr.org",
icon: "http://www.ubuntu-fr.org/favicon.ico",
preview:
function(pblock, directObject)
{
previewGoogle(pblock, directObject.text, directObject.text+"+site:forum.ubuntu-fr.org", 3);
}
});
Pour l'installer, allez sur le lien : chrome://ubiquity/content/editor.html
Puis copier le code dans le cadre.