My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# ----------------------------------------------------------------------------
# http://... - vários
# Busca as últimas notícias sobre linux em sites em inglês.
# Obs.: Cada site tem uma letra identificadora que pode ser passada como
# parâmetro, para informar quais sites você quer pesquisar:
#
# F)reshMeat Linux T)oday
# S)lashDot Linux W)eekly News
# O)S News
#
# Uso: zzlinuxnews [sites]
# Ex.: zzlinuxnews
# zzlinuxnews fs
#
# Autor: Thobias Salazar Trevisan, www.thobias.org
# Desde: 2002-11-07
# Licença: GPL
# ----------------------------------------------------------------------------
zzlinuxnews ()
{
zzzz -h linuxnews "$1" && return

local url limite
local n=5
local sites='fsntwo'

limite="sed ${n}q"

[ "$1" ] && sites="$1"

# Freshmeat
if zztool grep_var f "$sites"
then
url='http://freshmeat.net/?format=atom'
echo
zztool eco "* FreshMeat ($url):"
$ZZWWWHTML "$url" |
sed -n '1,/<entry>/d;s@.*<title>\(.*\)</title>@\1@p' |
$limite
fi

# Slashdot
if zztool grep_var s "$sites"
then
url='http://rss.slashdot.org/Slashdot/slashdot'
echo
zztool eco "* SlashDot ($url):"
$ZZWWWHTML "$url" |
sed '/<title>/!d ; s@.*<title>@@ ; s@</title>.*@@p' |
uniq |
$limite
fi

# Linux Today
if zztool grep_var t "$sites"
then
url='http://linuxtoday.com/backend/biglt.rss'
echo
zztool eco "* Linux Today ($url):"
$ZZWWWHTML "$url" |
sed -n '1,/<item>/d;s@.*<title>\(.*\)</title>@\1@p' |
$limite
fi

# LWN
if zztool grep_var w "$sites"
then
url='http://lwn.net/Articles'
echo
zztool eco "* Linux Weekly News - ($url):"
$ZZWWWHTML "$url" |
sed '/class="Headline"/!d;s/^ *//;s/<[^>]*>//g' |
$limite
fi

# OS News
if zztool grep_var o "$sites"
then
url='http://osnews.com'
echo
zztool eco "* OS News - ($url):"
$ZZWWWDUMP "$url" |
sed -n '/^ *By /{g;s/^ *//;p;};h' |
$limite
fi
}

Change log

r710 by aureliojargas on Mar 29, 2012   Diff
SEGURANÇA: $1 colocado entre aspas na
chamada padrão zzzz -h de todas as
funções.
Go to: 
Sign in to write a code review

Older revisions

r668 by aureliojargas on Mar 28, 2012   Diff
lint: removendo espaços inúteis.
r260 by aureliojargas on Dec 21, 2010   Diff
COMBO: mudança em todas as funções
para trocar a ordem das linhas no
cabeçalho. Agora é:

- Descrição de uma linha
...
r259 by aureliojargas on Dec 21, 2010   Diff
Adicionado o campo "Desde:" em todas
as funções que faltavam. Agora temos o
registro completo do nascimento de
todas.
All revisions of this file

File info

Size: 1935 bytes, 86 lines
Powered by Google Project Hosting