This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Processing Australian BOM Weather XML Data
#6
Fantastic. I came searching for parsing xml thinking I would have to start from scratch but the job has already been done. Thanks!!

For future users, some of the BoM files contain forecasts for multiple locations so you can generalise by changing the start of the function to search location instead of aac

Code:
-- Product ID from FTP Public Products and wanted location within the BoM file
local bomProduct = "IDV10450"
local location = "Melbourne"
function starttag(p, tag, attrs)
  if tag == 'area' and attrs.type == 'location' and attrs.description == location then

-- and later
data = socket.ftp.get("ftp://ftp.bom.gov.au/anon/gen/fwo/"..bomProduct..".xml")
Reply


Messages In This Thread
RE: Processing Australian BOM Weather XML Data - by sgraystar - 12.10.2023, 21:48

Forum Jump: