Organizations that post weather forecasts on the Internet assign numbers or letter codes to cities. They are used, in particular, by programs or scripts that automatically collect weather information from web pages.
Instructions
Step 1
On the Gismeteo website, the IDs of the most frequently requested are four-digit, while the rest are five-digit. First, try to find the name of the desired city or town on the main page of the site. If this does not work, enter the appropriate query in the field above the list, and then click the "Find" button. In the list of results that appears, select the first of the links. When the page with information about the weather in the city you are interested in loads, take a look at the address bar of your browser - the URL will end with a number. This is the identifier.
Step 2
The Yandex. Pogoda website used to use digital codes of a fixed five-digit length. After modernization, letter identifiers began to be used on it. To find out which letter code corresponds to your city or locality, first follow the link "Another city", then select first the country, then the region, and then the city. You can also enter its name in the field at the top of the page, and then click the Find button. After going to the page of a city or town, its identifier will also become part of the URL located in the address bar of the browser.
Step 3
The resource "Pogoda@mail. Ru" also uses alphabetic identifiers of cities. The process of finding them is similar to that described above for the Yandex. Weather site. Instead of clicking on the link "Another city" to display a list of settlements, click the button "Select city".
Step 4
Before writing a program or script to automatically collect weather information, read the user agreement of the site from which you want to receive this information. A link to this document is located at the bottom of the home page of the resource. It explains which automated data collection methods can and cannot be used. Please be aware that violation of the terms of this agreement may result in the blocking of your computer by account or IP address. And if your actions are regarded as a hacker attack, it is possible that the site owner will be prosecuted.