banepwn

chaturbate alert

May 4th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/bash
  2. username="$1"
  3. lastonline=false
  4. while true
  5. do
  6.     output=$(curl "https://chaturbate.com/$username/" | grep -F 'room_status\u0022: \u0022offline\u0022')
  7.     if [ -z "$output" ]
  8.     then
  9.         if [ "$lastonline" = true ]
  10.         then
  11.             echo "Still online!"
  12.         else
  13.             echo "Online!"
  14.             i3-nagbar -t warning -m "$1 is now online!"
  15.             lastonline=true
  16.         fi
  17.     else
  18.         if [ "$lastonline" = true ]
  19.         then
  20.             lastonline=false
  21.             echo "Now offline..."
  22.         else
  23.             echo "Still offline..."
  24.         fi
  25.     fi
  26.     sleep 5m
  27. done
Add Comment
Please, Sign In to add comment