luser@x60s_GPT /opt/isos % sudo pacman -Su
[sudo] password for luser:
:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...
Targets (2): webkitgtk2-1.10.2-1 webkitgtk3-1.10.2-1
Total Download Size: 20.35 MiB
Total Installed Size: 100.25 MiB
Net Upgrade Size: -23.67 MiB
Proceed with installation? [Y/n]
:: Retrieving packages from extra...
webkitgtk2-1.10.2-1-i686 7.3 MiB 397K/s 00:19 [#####] 100%
webkitgtk3-1.10.2-1-i686 13.1 MiB 454K/s 00:29 [#####] 100%
(2/2) checking package integrity [#####] 100%
(2/2) loading package files [#####] 100%
(2/2) checking for file conflicts [#####] 100%
(2/2) checking available disk space [#####] 100%
(1/2) upgrading webkitgtk2 [#####] 100%
(2/2) upgrading webkitgtk3 [#####] 100%
lundi 10 décembre 2012
lundi 3 décembre 2012
html pager `onliner` with xmllint aka Y U NO RTFM
TIL xmllint can interpret XPath expressions, and has a html parser. No more ugly frankensed expressions to deals with trees. Ahhh DSLs.
dummy@x60s_GPT ~ % for page in $(hrefs URL | egrep $(basename URL) | sort | uniq) ;
do
curl -sL ${page}
| xmllint --html --xpath '//*[@id="content"]' -
| html2text;
done | less
where hrefs is, note the old school sedism which will soon be deprecated:
dummy@x60s_GPT ~ % cat $(which hrefs)
#!/usr/bin/env dash
URL="${1}"
curl -sL ${URL} | sed 's.>.>\n.g' | sed -n '/href/I s@^.*href="\([^"]\+\)".*$@\1@Igp'
ps: no need to criticize my fault-tolerantless style; I'm still waiting for a whole lisp user-space so why bother...
dummy@x60s_GPT ~ % for page in $(hrefs URL | egrep $(basename URL) | sort | uniq) ;
do
curl -sL ${page}
| xmllint --html --xpath '//*[@id="content"]' -
| html2text;
done | less
where hrefs is, note the old school sedism which will soon be deprecated:
dummy@x60s_GPT ~ % cat $(which hrefs)
#!/usr/bin/env dash
URL="${1}"
curl -sL ${URL} | sed 's.>.>\n.g' | sed -n '/href/I s@^.*href="\([^"]\+\)".*$@\1@Igp'
ps: no need to criticize my fault-tolerantless style; I'm still waiting for a whole lisp user-space so why bother...
Inscription à :
Articles (Atom)