*nohtml*

local/bin/episodes

   1 #!/bin/bash
   2 
   3 tmdb(){ # {{{
   4     curl -s $1 | grep -o ' [0-9]* ([0-9]*): Episode [0-9]* - [^"]*' |
   5     uniq | sed 's/ [0-9]* ([0-9]*): Episode [0-9]* - //'
   6 } # }}}
   7 imdb(){ # {{{
   8     curl -s $1 | grep -o 'title="[^"]*" itemprop' | uniq | cut -d \" -f 2
   9 } # }}}
  10 wiki(){ # {{{
  11     w3m -dump -cols 1000 $1 | grep -o '"[^"]*"' | cut -d \" -f 2
  12 } # }}}
  13 
  14 for i in "$@"; do
  15     case $i in
  16         *imdb*) imdb $i | nl;;
  17         *wiki*) wiki $i | nl;;
  18         *themoviedb*) tmdb $i | nl;;
  19     esac
  20 done