Created
February 4, 2016 02:15
-
-
Save deanet/2ffd7b439ef2b820b40b to your computer and use it in GitHub Desktop.
grab id live youtube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
appstoken="" | |
user="" | |
currentid=`cat /tmp/currentid.txt` | |
newid=`/usr/bin/curl -vvv -L "https://www.youtube.com/user/arraudhahsolo" | grep "yt-badge-live" -B 10 | grep -A 5 "yt-lockup-title" | grep watch | sed -e 's/^.*\/watch?v=//g' | cut -d \" -f 1` | |
if [ "$newid" == "" ]; then | |
echo "id kosong, maybe tidak live"; | |
elif [ "$newid" == "$currentid" ]; then | |
echo "id masih sama"; | |
else [ "$newid" != "currentid" ]; | |
echo "mantabbb, newid: $newid"; | |
echo "$newid" > /tmp/currentid.txt; | |
/usr/bin/curl -L -v -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7" -F "token=$appstoken" -F "user=$user" -F "message=ar-raudhah live dengan id $newid" https://api.pushover.net/1/messages.json | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment