Simple script to see random TheCodingLove post in your terminal. Needs imgcat, curl, and pyquery.


~/bin/tcl

#!/usr/local/bin/python

from pyquery import PyQuery as pq
from subprocess import call

d = pq(url='http://thecodinglove.com/random/')

t = d('h3').text()
i = d('.post img').attr('src')
u = '/'.join(d('meta[property="og:url"]').attr('content').split('/')[:-1])
op = d('.post em').text()

print t
call('curl -q "%s" 2>/dev/null | imgcat' % i, shell=True)
print op, '-',  u