Extract JSON Data from OpenWeatherMap API

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extract JSON Data from OpenWeatherMap API

Laurent Gigon
Hi,

This is a code example that extract temperature from API :

protect;
var('results' =
include_url('https://api.openweathermap.org/data/2.5/weather?id=6077243&units=metric&appid=YOUR_API_KEY'));
$results = decode_json($results);
var('temperature' = $results->find('main'));
var('temperature' = $temperature->find('temp'));
/protect;
var('temperature')=Math_Round(var('temperature'),0);
Var('contenu_txt')='Montreal ' + var('temperature') + '°C';

It works fine for me, so if it can help anyone!

Laurent

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

FastCGI

Bill Yung
I’m running lasso 9 on CentOS 7. I’m often getting FastCGI -9945 Timeout errors.

I started off trying Spitfire and quickly abandoned that for Apache. When I get the errors, it’s the Spitfire airplane error page that shows up like attached.

The errors comes up exactly 5 seconds after I submit a request.  Where can I adjust this? I don’t see any FastCGI references in my http.conf or underlying .conf files.

Bill Yung
Boss of Me
IP Tech Devices
Rancho Santa Fe, CA
(859) 240-1024



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>