PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade

Go down

Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade Empty Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade

Post by jamied_uk 19th August 2017, 21:32

Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade

Vid



Code:

#/bin/bash
# (c) J~Net 2017
#
#  Example:
#  ./Get_Sub_Count_YT.sh
#
#
url="https://socialblade.com/youtube/user/"
id="jamieduk999"
echo "Hi, URL Set To "
out="$url$id"
wget $out
echo "Done"
echo ""
echo "Using Grep Now..."
cat  $id | grep "Subscribers" | sed 's/[^0-9]*//g' > out.txt
# Now keep only the YT Sub Count
head -n -1 out.txt > temp.txt ; mv temp.txt out.txt
#
cat out.txt
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade Empty Re: Getting Youtube Sub Count With Linux Mint 18.2 & Social Blade

Post by jamied_uk 19th August 2017, 22:09

YT Sub Counter For LCD Screen ESP 8266 Node MCU




Code:
#/bin/bash
# (c) J~Net 2017
#
#  Example:
#  ./Get_Sub_Count_YT.sh
#
#
url="https://socialblade.com/youtube/user/"
id="jamieduk999"
url_lcd="http://192.168.0.62/submit?text_display=123"
lcd_ip="192.168.0.62"
#
echo "Hi, URL Set To "
out="$url$id"
wget $out
echo "Done"
echo ""
echo "Using Grep Now..."
cat  $id | grep "Subscribers" | sed 's/[^0-9]*//g' > out.txt
# Now keep only the YT Sub Count
head -n -1 out.txt > temp.txt ; mv temp.txt out.txt
#
cat out.txt
echo "Transmitting To LCD Server...."
myvar=`cat out.txt` && curl --data "text_display=$myvar Subs" "$lcd_ip"/submit &> /dev/null
#
#   curl --data "text_display=$uin" 192.168.0.62/submit
#
echo "Subs Displayed On LCD."
#$myvar=$('cat out.txt')
#wget "$url_lcd"/submit?text_display="$myvar"
# https://stackoverflow.com/questions/4881930/remove-the-last-line-from-a-file-in-bash
#
# https://stackoverflow.com/questions/18204326/how-to-post-url-in-data-of-a-curl-request
#
# put into var
#
# remove uneeded files
rm $id
echo "All Done"
echo "Want to run again?"
read -n 1 -s -r -p "Press any key to continue Or Ctrl C"
#
bash Get_Sub_Count_YT.sh
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum