Skip to content

Instantly share code, notes, and snippets.

@avicoder
Created May 16, 2018 06:58
Show Gist options
  • Save avicoder/986af4d8c01ed88090dfccac86123709 to your computer and use it in GitHub Desktop.
Save avicoder/986af4d8c01ed88090dfccac86123709 to your computer and use it in GitHub Desktop.
Check for key validation
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