Created
January 10, 2022 22:49
-
-
Save joshuaziering/1c6c968c7061c5ad903ee2935238f57b to your computer and use it in GitHub Desktop.
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
function Airspace(lat, long) { | |
var url = "https://air.aloft.ai/airspace-api/airspace"; | |
var key = "YOUR-KEY-GOES-HERE"; | |
var payload = 'geometry={"type":"Point","coordinates":['+long+','+lat+']}'; | |
var options = { | |
'method' : 'post', | |
'payload' : payload, | |
'headers': {'Authorization': 'Bearer '+ key} | |
}; | |
var response = UrlFetchApp.fetch(url, options); | |
var responsejson = response.getContentText(); | |
var response = JSON.parse(responsejson); | |
return response.color.name; | |
} | |
function B4UFly(lat, long) | |
{ | |
return 'https://b4ufly.aloft.ai/?lat='+lat+'&long='+long; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment