~alienagain/gigur

b1918cbc0a20437075d48ff3dd1393e2a8f2cb77 — terceranexus6 1 year, 11 months ago dded3fd master
adding a command-line tool for getting temporary sms numbers
1 files changed, 37 insertions(+), 0 deletions(-)

A check_sms/get_SMS.sh
A check_sms/get_SMS.sh => check_sms/get_SMS.sh +37 -0
@@ 0,0 1,37 @@
#!/bin/bash

repeat="Y"
country=$1
curl -s https://online-sms.org/Free-$country-Phone-Number | grep "Receive SMS" > numbers_list
list=$(while read -r line; do echo "$line" | tr -dc '0-9'; echo -e "\n"; done < numbers_list)

echo "Numbers from $country:"
echo $list

echo -e "\nSelecting random..."
my_list=($list)

lenght_=${#my_list[@]}
random_n=$(( $RANDOM % $lenght_ + 1 ))

echo "the random number selected is ${my_list[$random_n]}"
echo -e "\n"
read -p"Click ENTER when you used the number" DUMMY

base="https://online-sms.org/free-phone-number-"
number="${my_list[$random_n]}"

link="$base$number"

while [ "$repeat" = "Y" ]
do
	curl -s $link > last_sms
	strings last_sms | grep -A11 Sender > last_sms_value
	rm last_sms
	strings last_sms_value | sed 's/<[^>]*>/\n/g' > last_sms_wout_html
	rm last_sms_value

	strings last_sms_wout_html
	
	read -p"Keep receiving message from this number? Y/N: " repeat
done