Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1.   1 #!/bin/bash
  2.   2
  3.   3 num_episodes=77
  4.   4 cheekys_episodes=`curl -s 'https://cheekyvideos.net/' | grep -o 'Murdoch Murdoch Video Archive \[[[:digit:]]*\]' | grep -o '[[:digit:]]*'`
  5.   5 new_eps=$(($cheekys_episodes - $num_episodes))
  6.   6
  7.   7 # full text
  8.   8 case $new_eps in
  9.   9   -*) echo "Error: set num_episodes in the source file" ;;
  10.  10   0) echo "No new episodes" ;;
  11.  11   1) echo "1 new episode!" ;;
  12.  12   *) echo "$new_eps new episodes!" ;;
  13.  13 esac
  14.  14
  15.  15 #short text
  16.  16 echo "$new_eps new eps"
  17.  17
  18.  18 # color
  19.  19 if [ $new_eps -gt 0 ]; then
  20.  20   echo "#FF0000"
  21.  21 else
  22.  22   echo "#FFFFFF"
  23.  23 fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement