Wednesday, November 25, 2015

Display cricket score on Unix Terminal


If your job demands you to be on Unix console all the time and you happen to be one who can not avoid watching the cricket score, something you would like:
The script:
#!/bin/sh
#Get cricket score on your unix console top corner, enjoy cricket while you work ..

columns=$(tput cols)
startpoint=$(($columns-100))
matchurl='http://www.espncricinfo.com/india-v-south-africa-2015-16/engine/match/903607.html'

while :
do
  line=$(wget -q -O- $matchurl  | awk -F '=' '/og:title/ {print $3}' | awk -F '|' '{print $1}' | sed 's/"//g')
  echo -en "\033[s"    #save current screen position & attributes
  tput cup 0 $startpoint
  echo -en "\033[42m$line\033[0m"
  echo -e -n "\033[u"
  sleep 15
done
Output:

5 comments:

Unknown said...

This is great. Can you create something similar for football? :P

Unknown said...

Thanks Rakesh !

Unknown said...

Thanks for sharing.
More unix command lines here: http://www.blackhatforum.co

deepak singh said...

Thanks for providing this informative information you may also refer.
http://www.s4techno.com/blog/2016/07/11/aix-user-administration-2/

Ram Chauhan said...

Good post....thanks for sharing.. very useful for me... Thanks. Complete Set of Desktop on Rent

© Jadu Saikia www.UNIXCL.com