Makin-Things / bom-radar-card

A rain radar card using the new tiled images from the Australian BOM
https://github.com/makin-things/bom-radar-card
MIT License
98 stars 9 forks source link

Utility to scrape radars #30

Closed bossanova808 closed 1 year ago

bossanova808 commented 1 year ago

(not a bug!)

Just an FYI - I wrote a little Python thing that scrapes the BOM radar info page and outputs a list or radars, in both Python and JS formats.

Might be useful for keeping your list of radars up to date.

It lives here: https://github.com/bossanova808/weather.ozweather/blob/main/resources/lib/bom/bom_radar_scrape_latest.py

And here's some sample JS output:

const bomRadarLocations = [
    // http://www.bom.gov.au/australia/radar/info/nsw_info.shtml
    [-29.96, 146.81, "Brewarrina", "IDR933"],
    [-35.66, 149.51, "Canberra (Captain's Flat)", "IDR403"],
    [-29.62, 152.97, "Grafton", "IDR283"],
    [-33.55, 145.52, "Hillston", "IDR943"],
    [-29.50, 149.85, "Moree", "IDR533"],
    [-31.0240, 150.1915, "Namoi (Blackjack Mountain)", "IDR693"],
    [-32.730, 152.027, "Newcastle", "IDR043"],
    [-29.033, 167.933, "Norfolk Island", "IDR623"],
    [-33.701, 151.210, "Sydney (Terrey Hills)", "IDR713"],
    [-35.17, 147.47, "Wagga Wagga", "IDR553"],
    [-34.264, 150.874, "Wollongong (Appin)", "IDR033"],
    [-32.74, 148.70, "Yeoval", "IDR963"],
    // http://www.bom.gov.au/australia/radar/info/vic_info.shtml
    [-37.86, 144.76, "Melbourne", "IDR023"],
    [-34.28, 141.59, "Mildura", "IDR973"],
    [-37.89, 147.56, "Bairnsdale", "IDR683"],
    [-35.99, 142.01, "Rainbow", "IDR953"],
    [-36.03, 146.03, "Yarrawonga", "IDR493"],
    // http://www.bom.gov.au/australia/radar/info/qld_info.shtml
    [-19.88, 148.08, "Bowen", "IDR243"],
    [-27.39, 153.13, "Brisbane Airport", "IDR1053"],
    [-27.718, 153.240, "Brisbane (Mt. Stapylton)", "IDR663"],
    [-16.82, 145.68, "Cairns", "IDR193"],
    [-23.5494, 148.2392, "Emerald (Central Highlands)", "IDR723"],
    [-23.86, 151.26, "Gladstone", "IDR233"],
    [-18.99, 144.99, "Greenvale", "IDR743"],
    [-25.957, 152.577, "Gympie (Mt Kanigan)", "IDR083"],
    [-23.43, 144.29, "Longreach", "IDR563"],
    [-21.12, 149.22, "Mackay", "IDR223"],
    [-27.61, 152.54, "Marburg", "IDR503"],
    [-16.67, 139.17, "Mornington Island", "IDR363"],
    [-20.7114, 139.5553, "Mount Isa", "IDR753"],
    [-20.75, 143.14, "Richmond", "IDR1073"],
    [-25.696, 149.898, "Taroom", "IDR983"],
    [-19.42, 146.55, "Townsville (Hervey Range)", "IDR733"],
    [-26.44, 147.35, "Warrego", "IDR673"],
    [-12.67, 141.92, "Weipa", "IDR783"],
    [-16.288, 149.965, "Willis Island", "IDR413"],
    // http://www.bom.gov.au/australia/radar/info/wa_info.shtml
    [-34.94, 117.80, "Albany", "IDR313"],
    [-17.95, 122.23, "Broome", "IDR173"],
    [-24.88, 113.67, "Carnarvon", "IDR053"],
    [-20.65, 116.69, "Dampier", "IDR153"],
    [-31.78, 117.95, "South Doodlakine", "IDR583"],
    [-33.83, 121.89, "Esperance", "IDR323"],
    [-28.80, 114.70, "Geraldton", "IDR063"],
    [-25.03, 128.30, "Giles", "IDR443"],
    [-18.23, 127.66, "Halls Creek", "IDR393"],
    [-30.79, 121.45, "Kalgoorlie-Boulder", "IDR483"],
    [-22.10, 114.00, "Learmonth", "IDR293"],
    [-33.097, 119.009, "Newdegate", "IDR383"],
    [-32.39, 115.87, "Perth (Serpentine)", "IDR703"],
    [-31.93, 115.98, "Perth Airport", "IDR263"],
    [-20.37, 118.63, "Port Hedland", "IDR163"],
    [-30.36, 116.29, "Watheroo", "IDR793"],
    [-15.45, 128.12, "Wyndham", "IDR073"],
    // http://www.bom.gov.au/australia/radar/info/sa_info.shtml
    [-34.617, 138.469, "Adelaide (Buckland Park)", "IDR643"],
    [-35.33, 138.50, "Adelaide (Sellicks Hill)", "IDR463"],
    [-32.13, 133.70, "Ceduna", "IDR333"],
    [-37.75, 140.77, "Mt Gambier", "IDR143"],
    [-31.16, 136.80, "Woomera", "IDR273"],
    // http://www.bom.gov.au/australia/radar/info/tas_info.shtml
    [-43.1122, 147.8061, "Hobart (Mt Koonya)", "IDR763"],
    [-41.181, 145.579, "West Takone", "IDR523"],
    [-42.83, 147.51, "Hobart Airport", "IDR373"],
    // http://www.bom.gov.au/australia/radar/info/nt_info.shtml
    [-23.82, 133.90, "Alice Springs", "IDR253"],
    [-12.46, 130.93, "Darwin/Berrimah", "IDR633"],
    [-12.28, 136.82, "Gove", "IDR093"],
    [-14.51, 132.45, "Katherine/Tindal", "IDR423"],
    [-11.6494, 133.38, "Warruwi", "IDR773"]
]
Makin-Things commented 1 year ago

Thanks this could be useful. I just have to figure out if the latest changes the BOM made can be overcome.