Ubiquity para páginas amarelas e dicionário priberam

Posted: September 18th, 2008 | Author: sofia | Filed under: simple, useful | Tags: , , | 8 Comments »

Para me divertir e porque me era útil decidi criar 2 comandos ubiquity para o firefox, um para o pai.pt e outro para o dicionário priberam.
O pai.pt foi fácil, bastou usar o searchCommand et voilá:

makeSearchCommand({
name: "pai",
url: "http://pai.pt/search/{QUERY}.html",
icon: "http://pai.pt/favicon.ico",
description: "Pesquisa nas páginas amarelas (pai.pt); Seaches the portuguese yellow pages."
});

No caso do dicionário priberam a coisa foi um pouco mais trabalhosa, primeiro tudo aquilo funciona à base de javascript no site (após alguma leitura do código lá percebi que faziam à mesma um pedido GET) e depois porque foi necessário codificar os parametros GET porque palavras com acentos estavam a falhar. Neste caso tive que usar o createCommand pois por enquanto não é possível escapar os parâmetros GET no searchCommand.

CmdUtils.CreateCommand({
name: "priberam",
description: "Searches the portuguese dictionary priberam",
help: "Try issuing "priberam aglet"",
icon: "http://priberam.pt/favicon.ico",
takes: {"pal": noun_arb_text},
execute: function( directObj ) {
var word = directObj.text;
Utils.openUrlInBrowser( "http://priberam.pt/dlpo/definir_resultados.aspx?pal=" + escape(word) );
}
});

O comando das páginas amarelas está aqui (comando pai) e o da priberam está aqui (comando priberam).

[Update: Acabei de reparar que o Rui Moura já tinha construído um comando para o dicionário priberam aqui. De qualquer modo, ao menos não são iguais porque a versão dele usa o searchCommand e como tal falha no caso de palavras com acentos ou caracteres especiais, ex. doçura.]

[Update 2: O Miguel Pais tem a versão mais completa neste momento (instalar aqui), com preview e também lida bem com caracteres especiais. Vejam os comentários abaixo.]

[For the english readers: to sum it up, when you need to escape accented characters in the query parameter use createCommand instead of searchCommand; see example code above).]


quick tip: installing the missing quartz-wm for Cross Over Chrome

Posted: September 17th, 2008 | Author: sofia | Filed under: useful | Tags: , , | No Comments »

Those that decided to try out the chrome cross over port on their macs probably noticed that when chrome is first run, it strongly encourages the installation of quartz-wm included in Apple X11, in turn included in the cd. First i tried to reinstall X11 but it said i had a newer version so tried this tip that proved helpful 10.4: Provide Crossover with a missing quartz-wm and curiosity satisfied (hmm.. probably killed the cat and a bit of my time as well), i now have a working chrome in my mac.


quick tip: phpSecurityscanner with xampp

Posted: September 10th, 2008 | Author: sofia | Filed under: useful | Tags: , , , | No Comments »

Just a quick tip for those that want to use phpSecurityScanner but also use xampp/mampp. By default the scanner uses the local mysql server but since i’m used to xampp i wanted to use its mysql server.

So when i first ran the tool i got
[nativecode=Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)]
which was natural since what i’d started was xampp. To fix this i just added to bin/config.php, right after set_include_path, the following :
ini_set(’mysql.default_socket’,'/Applications/xampp/xamppfiles/var/mysql/mysql.sock’);


An anthropological introduction to YouTube

Posted: September 5th, 2008 | Author: sofia | Filed under: humane | No Comments »


An anthropological introduction to YouTube presented at the Library of Congress in June 2008 by Michael Wesch, a professor of digital ethnography at Kansas State University.

Well worth the time, funny, endearing, informative :=).