I would like to grab data from a certain website periodically (every 2-3 hours).
Website is weather related: http://meteo.gov.ge/index.php?l=2&pg=cm&ct=1&cm=
They also provide widget: http://meteo.gov.ge/index.php?pg=sb but I need something more personalized on my webpage… I only need to grab temperature in number and weather icon for any city.
On my ubuntu: I would probably try to use curl + grep/regex and cron it.
But how would I do that in php? Can I use in anyway the fact that they provide widget (I doubt, since it is embedded in image)?
p.s. this is not content stealing, it is a gov site thus financed by my (tax payer) money! I should be able to grab data I need, from service I pay for >:)
Tipically this kind of weather services offer RESTFUL web services (API) to get data:
You execute an http GET or POST providing some parameters (for example the name of the city you want to retreive weather forecasts) and they send you a piece of xml with the detailed forecasts.
Then is up to you to parse the returned xml and disply only the info you want.
I absolutely discourage you to grub the entire html content of the homepage of the weather site you shared.
Image they suddently change the structure of the page,dimensions and so on, your code will fail.
You need a structred way to get the forecasts, this is why API exists. If the site doesn’t provide you API try to search another weather forecast site for your country!