Skip to content

Commit

Permalink
Issue #29 and #27 has been fixed
Browse files Browse the repository at this point in the history
Since free API has only 250 request per month, Once your limit is reached, you wont be able to access it or use that module.
  • Loading branch information
Aravindha1234u committed Jun 26, 2020
1 parent 085cdf4 commit e9f7684
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions plugins/Phonenumber.py
Expand Up @@ -9,17 +9,20 @@ def Phonenumber(ph):
exit()
url = ("http://apilayer.net/api/validate?access_key="+api_key+"&number="+str(ph))
response=requests.get(url)
if "91" not in str(ph):
print("Error: CountryCode is missing")
else:
if response.status_code ==200:
get=response.json()
print("Number: "+get['number'])
print("Type: "+get['line_type'])
print("CountryCode: "+get['country_code'])
print("Country: "+get['country_name'])
print("Location: "+get['location'])
print("Carrier: "+get['carrier'])
print("")
try:
if "91" not in str(ph):
print("Error: CountryCode is missing")
else:
print("Error: Invalid Mobile Number")
if response.status_code ==200:
get=response.json()
print("Number: "+get['number'])
print("Type: "+get['line_type'])
print("CountryCode: "+get['country_code'])
print("Country: "+get['country_name'])
print("Location: "+get['location'])
print("Carrier: "+get['carrier'])
print("")
else:
print("Error: Invalid Mobile Number")
except:
print(str(response.json()['error']['info']).split(".")[0])

0 comments on commit e9f7684

Please sign in to comment.