Extract JSON Data from OpenWeatherMap API

classic Classic list List threaded Threaded
3 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]>
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI

Brad Lindsay
Bill,

The exactly 5 seconds is interesting. If you’re using mod_fcgid for
fast CGI connection, then you may have this configuration set:

https://httpd.apache.org/mod_fcgid/en/mod/mod_fcgid.html#fcgidiotimeout

If that doesn’t help, this post might:

https://serverfault.com/questions/80929/disable-the-timeouts-on-apache-httpd-and-fastcgi

Good luck!
Brad


On February 1, 2019 at 3:39:33 PM, Bill Yung ([hidden email]) wrote:

> 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:
> Send administrative queries to

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

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]>