Command-line script to fetch latest scores of Live matches of Cricket. Uses pyquery.


from pyquery import PyQuery as pq

data = pq(url='')
live = data('')

for idx, event in enumerate(live):
    for line in live.find('.event-info div'):
        print pq(line).text().strip()
    print ''

cric | pbcopy

BLR 12/1 (1.3 Overs)
GL 158/10;
Bengaluru, India
Indian Premier League, 201...

Bonus: cool poll function

function cric() {
    IFS=$'\n' #'
    tput sc
    while true; do
        tput rc; tput ed;
        for line in `~/bin/cric`; do
            printf "$line\n"
        sleep 30