Skip to content

Instantly share code, notes, and snippets.

@antoniodourado
Created July 31, 2009 12:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoniodourado/159208 to your computer and use it in GitHub Desktop.
Save antoniodourado/159208 to your computer and use it in GitHub Desktop.
Hack para fazer buscas no Mercado Livre BR
/* Hack para o Mercado Livre Versão 0.1
Sintaxe:
-ml <conteudo de pesquisa>
-mercadolivre <conteudo de pesquisa>
Todos os direitos reservados.
*/
CmdUtils.CreateCommand({
names: ["mercadolivre","ml"],
icon: "http://www.mercadolivre.com.br/favicon.ico",
description: "Realiza buscas no mercado livre",
help: "Digite ml ou mercadolivre seguido do termo a ser pesquisado no Mercado Livre.",
author: {name: "Antonio Dourado", email: "antoniodourado@gmail.com"},
license: "GPL",
homepage: "www.twitter.com/antoniodourado",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
var schString = jQuery.trim(args.object.text);
if(schString.length > 0)
pblock.innerHTML = "Sua busca no mercado livre será feita com o seguinte conteúdo \n <b>" + args.object.html + "</b>.";
else
pblock.innerHTML = "Você deverá digitar palavras para a busca!";
},
execute: function execute(args) {
var schString = jQuery.trim(args.object.text);
var urlSite = "http://lista.mercadolivre.com.br/";
if(schString.length > 0){
schString = schString.replace(/\s/g,'-');
Utils.openUrlInBrowser(urlSite+schString);
}
else
displayMessage("Não foram informadas palavras para a busca.")
}
});
@10276473738
Copy link

Roupas

@10276473738
Copy link

Legal

@10276473738
Copy link

Jgjdhsh

@10276473738
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment