2 ms·
curl -s http://news.ycombinator.com/news | \ tidy -quiet -asxml -numeric -utf8 -file /dev/null | \ xmlstarlet sel \ -N x=http://www.w3.org/1999/xhtml \ -t
by reirob 15y ago
curl -s http://news.ycombinator.com/news | \
tidy -quiet -asxml -numeric -utf8 -file /dev/null | \
xmlstarlet sel \
-N x=http://www.w3.org/1999/xhtml \
-t -m "//x:tr[x:td[1][@class='title']]" \
-v "normalize-space(x:td[3][@class='title']/x:a)" -o ";" \
-v "x:td[3][@class='title']/x:a/@href" -o ";" \
-v "str:tokenize(following-sibling::x:tr[1]/x:td[2]/x:span[1], ' ')[1]" -o ";" \
-v "following-sibling::x:tr[1]/x:td[2]/x:a[1]" -n | \
xmlstarlet unesc
- sukuriant 15y agoThank you.