sunjester's username checker for social media 01-11-2019, 02:14 PM
#1
https://github.com/therealsunjester/userchecker
Introduction
There was a post about "sherlock" a python script for checking usernames on social media websites. They didn't want to fix their code and support my version of python, they suggested an upgrade. So I coded my own that uses NO DEPENDENCIES. I used bash 4.3, you can check your version using the bash --version command, as seen below (my version).
Adding Sites
To add your own social media site, add it to the already existing array in the script. The script will add the username from the argument to the link, do not add a trailing slash or the script may not get the right URL to check. For example, for Github, the link is https://github.com since github usernames are added to the base URL, like this, https://github.com/therealsunjester.
Example Usage
Introduction
There was a post about "sherlock" a python script for checking usernames on social media websites. They didn't want to fix their code and support my version of python, they suggested an upgrade. So I coded my own that uses NO DEPENDENCIES. I used bash 4.3, you can check your version using the bash --version command, as seen below (my version).
Code:
(xenial)root@localhost:~/Downloads# bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Adding Sites
To add your own social media site, add it to the already existing array in the script. The script will add the username from the argument to the link, do not add a trailing slash or the script may not get the right URL to check. For example, for Github, the link is https://github.com since github usernames are added to the base URL, like this, https://github.com/therealsunjester.
Code:
#!/bin/bash
#sunjester
echo "checking for username: "$@
RED=`tput setaf 1`
GRN=`tput setaf 2`
RST=`tput sgr0`
sites=(
"https://www.facebook.com"
"https://www.instagram.com"
"https://www.twitter.com"
"https://www.youtube.com/user"
"https://www.reddit.com/user"
)
for site in "${sites[@]}"
do
res=$(curl -Is $site"/"$@"/" >social;head -n1 social)
code=`echo $res|cut -d' ' -f2`
case $code in
200)
echo $GRN $site"/"$@"/" $RST
;;
404)
echo $RED $site"/"$@"/" $RST
;;
301)
echo $GRN $site"/"$@"/" $RST
;;
405)
echo $RED $site"/"$@"/" $RST
;;
esac
done
rm social
Example Usage
![[Image: L8hs25m.gif]](https://i.imgur.com/L8hs25m.gif)
(This post was last modified: 02-05-2019, 05:51 AM by sunjester.
Edit Reason: script fixes
)