Random TheCodingLove In Your Terminal!

Simple script to see random TheCodingLove{:rel=”nofollow”} post in your terminal. Needs imgcat, curl, and pyquery.


~/bin/tcl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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