Reformat file

pull/3/head
Tejasvi Nareddy 6 years ago
parent 8abeaac017
commit 8ed7a39b86

@ -2,6 +2,7 @@ import requests
import json
import os
def write_to_file(url, fname):
with open(fname, "a") as f:
f.write(url + "\n")
@ -26,10 +27,13 @@ def main():
if os.path.isfile(fname):
os.remove(fname)
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Removing previous file:\033[1;37m {}\033[0m".format(fname))
print(
"\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Removing previous file:\033[1;37m {}\033[0m".format(fname))
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Checking username\033[0m\033[1;37m {}\033[0m\033[1;92m on: \033[0m".format(username))
print(
"\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Checking username\033[0m\033[1;37m {}\033[0m\033[1;92m on: "
"\033[0m".format(
username))
raw = open("data.json", "r")
data = json.load(raw)
@ -44,7 +48,6 @@ def main():
url = data.get(social_network).get("url").format(username)
error_type = data.get(social_network).get("errorType")
r = requests.get(url, headers=headers)
if error_type == "message":
@ -77,4 +80,5 @@ def main():
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Saved: \033[37;1m{}\033[0m".format(username + ".txt"))
main()
Loading…
Cancel
Save