Hello! A long time ago I did not write any articles, and indeed, I had long wondered whether to publish this topic or not, but nevertheless decided.
"For what"

For the sake of interest, on his "hamster"
(once this phrase was a bit popular 5 years ago) there appeared a desire to fasten a weather informer.
Moreover, I wanted to see in him a kind of minimalism - the current temperature and a pretty little icon
(sun, cloud or snow) .
Solutions offered by many weather services are relatively cumbersome and, in my opinion, not very pleasant to the eye :) I would like to do something of my own)
')
It is most pleasant for me to use the services of Yandex, so I asked myself the question
“how to make my Yandex.Wall?” :)
"In the bins ..."
10 minutes of “digging” in the depths of the Internet gave me an answer on how to get the weather XML with all the data we need.
1.
Get the id of the city. You can look at the
list of cities (simple Ctrl + F looking for a city)
periodically to the file not to reach (404 crashes)
id can be found in the second way: type in the query in Yandex - the
weather in ...... (and see the address of the link)
For example: Kemerovo id = 296422. Actually, now we can take
xml itself.
Link format
export.yandex.ru/weather-ng/forecasts{id_city}.xml
For our example:
http://export.yandex.ru/weather-ng/forecasts/29642.xml3.
The parser . Here, as you please, you can roam) I do not pretend to the genius of the code, but for example my file
iknowweater.php <?php $city_id=29642;
we get something like
To display a list of weather in different cities, you can use a normal cycle) as you like)
In order not to violate copyrights, we add copyright with appropriate references to the source.
Weather data is provided by the
Yandex.Pogoda service (or as it is on their page - Data is provided by
FORECA ).
4. Enable the script, write the style and
enjoy .
PS For lovers of sprinkling saliva: I do not pretend to the originality of the decision and the genius of the performance, the article was written as one of the options.
Of course, you can do anything and caching, and generally a full-featured site based on data and attributes, but why? (for example, it is enough, the main thing is that it performs its function. Suddenly, someone will come in handy)
There was no talk of any commercial use or profit gain. Everything was done for fun.