Wednesday, September 30, 2015

Another ways of reading #AmazingFact

Another ways of reading #AmazingFact @amazingfacts on unix like operating system

Requirements:
Installed elinks text browser, you can install it on ubuntu for example with
sudo apt-get install elinks

link=$"bit.ly/1wICTcd" && elinks -dump  $link | sed -n '/separator/,/Subscribe to/p' | sed -r 's/^(.{49}).*/\1/' | sed '1d; $d'

or if printer is connected
link=$"bit.ly/1wICTcd" && lp <(elinks -dump  $link | sed -n '/separator/,/Subscribe to/p' | sed -r 's/^(.{49}).*/\1/' | sed '1d; $d')

or also for printing you can copy/paste text and (after installing xsel)
lp <(xsel -o)
or copy/paste in libreoffice and so on

Mentioning libreoffice I'll have to admit that libreoffice calc is really slow for openning/saving files, so I switched on gnumeric.