Created
May 16, 2018 06:58
-
-
Save avicoder/986af4d8c01ed88090dfccac86123709 to your computer and use it in GitHub Desktop.
Check for key validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mapbox import Geocoder | |
def banner(): | |
return "\n[*] " | |
def mapbox(): | |
API_TOKEN = raw_input("Enter the Mapbox API key here and press enter:\n") | |
token_type = API_TOKEN[:2] | |
if token_type == "pk": | |
print "\n[+] Key is Public" | |
if token_type == "sk": | |
print "\n[+] Key is Private" | |
geocoder = Geocoder(access_token=API_TOKEN) | |
response = geocoder.forward('Chester , NJ') | |
if response.status_code == 200: | |
print "\n[+] Key is Valid" | |
elif response.status_code == 401: | |
print "\n[+] Key is Invalid" | |
else: | |
print "\n[-] Check - Unsuccessful" | |
def gcm(): | |
//TODO | |
pass | |
def appflyer(): | |
//TODO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment