A
A
Artem Gvozdev2018-11-28 11:53:31
PHP
Artem Gvozdev, 2018-11-28 11:53:31

Using the weather API?

Good afternoon everyone, I'm making a website, and one question arose here, how can I make a weather forecast widget.
what is
the API - www.gismeteo.by/api/ and https://darksky.net/dev/docs
The answer comes in JSON
This is the weather API
The site itself is on Wordpress, there is a custom post type for example with countries, how to pull up temperature for example through the API country capitals when creating a new post in custom post type - countries?
an example where it has already been done - https://chip.travel/tury/israel
I want the same

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
OnYourLips, 2015-12-11
@OnYourLips

That is, in other words, what is faster to immediately generate a page using PHP
Equally.
If you need SPA then the second way, otherwise the first.

A
Anatoly Evladov, 2015-12-11
@Visteras

You gave an example of interpreted languages.
If you need faster - look at compiled languages.

I
Igor Vorotnev, 2018-12-06
@HeadOnFire

Use wp_remote_get() or wp_remote_post() to get data from API + Transients for caching responses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question