File: zzdefine.sh

package info (click to toggle)
funcoeszz 21.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 4,424 kB
  • sloc: sh: 27,355; perl: 509; xml: 54; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# ----------------------------------------------------------------------------
# http://www.google.com
# Retorno da função "define:" do Google.
# Idiomas disponíveis: en pt es de fr it. O idioma padrão é "all".
# Uso: zzdefine [idioma] palavra_ou_sigla
# Ex.: zzdefine imho
#      zzdefine pt imho
#
# Autor: Fernando Aires <fernandoaires (a) gmail com>
# Desde: 2005-05-23
# Versão: 1
# Licença: GPL
# ----------------------------------------------------------------------------
# DESATIVADA: 2013-02-28 Parou de funcionar (issue #53)
zzdefine ()
{
	zzzz -h define "$1" && return

	[ "$1" ] || { zztool uso define; return 1; }

	local L='all' I='en pt es de fr it all '

	[ "${I% $1 *}" != "$I" ] && L=$1 && shift

	$ZZWWWDUMP -width=78 "http://www.google.com/search?q=define:$1&hl=pt-br&ie=UTF-8&defl=$L" |
		sed '1,/^ *Web$/ d' |
		sed '/Encontrar definições de imho em:/,$ d' |
		sed '/Página Inicial do Google/,$ d'
}