How do i use Dark Sky API with livecode?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How do i use Dark Sky API with livecode?
Hey Guys
I am a beginner with livecode and i can't for the life of me figure out how to call for the API and use the data that it gives me. I have integrated the easyjson script in my stack and pasted the:
" $_GET url "
and i get nothing. I am probably missing alot but i don't know how to get it to work, i've googled alot and to be honest there isn't that much about livecode stuff...
My goal is to create a weather app
I am a beginner with livecode and i can't for the life of me figure out how to call for the API and use the data that it gives me. I have integrated the easyjson script in my stack and pasted the:
" $_GET url "
and i get nothing. I am probably missing alot but i don't know how to get it to work, i've googled alot and to be honest there isn't that much about livecode stuff...
My goal is to create a weather app
Re: How do i use Dark Sky API with livecode?
Post some links to what you're talking about, so we can take a look..
Re: How do i use Dark Sky API with livecode?
I wanna use the API from here darksky(dot)net/dev/docs/forecast and i dont know how to "call" for the data it has available
-
- Posts: 253
- Joined: Wed Aug 19, 2015 4:29 pm
Re: How do i use Dark Sky API with livecode?
This should get you started. You won't need easyJSON, because the newer JSONimport function works just great. Just replace YOUR KEY HERE with your secret key from darksky and throw this script into button.
Code: Select all
on mouseUp
get url "https://api.darksky.net/forecast/YOUR KEY HERE/42.3601,-71.0589"
put it into tForecast
put JSONimport(tForecast) into tForecastArray
answer "It is currently"&&tforecastarray[currently][temperature]&&"degrees and"&&tforecastarray[currently][summary]
end mouseUp
Re: How do i use Dark Sky API with livecode?
Oh thank you this is great, i've been trying to get it to show directy on the screen withClipArtGuy wrote:This should get you started. You won't need easyJSON, because the newer JSONimport function works just great. Just replace YOUR KEY HERE with your secret key from darksky and throw this script into button.
Code: Select all
on mouseUp get url "https://api.darksky(dot)net/forecast/YOUR KEY HERE/42.3601,-71.0589" put it into tForecast put JSONimport(tForecast) into tForecastArray answer "It is currently"&&tforecastarray[currently][temperature]&&"degrees and"&&tforecastarray[currently][summary] end mouseUp
on start
end start
but yeah that didnt work, how do i make it show right on the card all the time and not just in a pop up window when i click on a button?
Thanks again mate!
Re: How do i use Dark Sky API with livecode?
put it in to a field
Re: How do i use Dark Sky API with livecode?
Hi jolleboi,
1. welcome to the forum!
2. Looks like you could need some basics about LC, check these great learning resources:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
1. welcome to the forum!
2. Looks like you could need some basics about LC, check these great learning resources:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus