Simple python command-line script to display quote of the day in your terminal.


~/bin/qotd

#!/usr/local/bin/python
from pyquery import PyQuery as pq
from sys import argv
from subprocess import check_call

home = pq(url='http://www.brainyquote.com/quotes_of_the_day.html')

node = home('.bqPhotoDefault:first')

if '-i' in argv:
	src = 'http://www.brainyquote.com' + node.attr('src')
	check_call('curl -q "%s" 2>/dev/null | imgcat' % src, shell=True)
else:
	print node.attr('alt').strip()

> qotd

For success, attitude is equally as important as ability. - Walter Scott


> qotd -i

qotd


This script can be further extended to: create a wallpaper for the quote with a hd background or a gradient, set the image as wallpaper, etc.

It can also be written without PyQuery external dependency.