{"id":22428423,"url":"https://github.com/momsfriendlydevco/bom","last_synced_at":"2025-03-27T06:43:48.053Z","repository":{"id":78689311,"uuid":"126308223","full_name":"MomsFriendlyDevCo/bom","owner":"MomsFriendlyDevCo","description":"Scraper for the Australian Bureau of Meteorology (BOM) - including radar images","archived":false,"fork":false,"pushed_at":"2021-11-03T02:59:17.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-19T00:03:38.694Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MomsFriendlyDevCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-22T09:05:16.000Z","updated_at":"2024-12-08T12:33:56.000Z","dependencies_parsed_at":"2023-03-07T08:15:52.537Z","dependency_job_id":null,"html_url":"https://github.com/MomsFriendlyDevCo/bom","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"f4f7f9ab59d7276a3e64b4386fbf9a4be95dc2b9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fbom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fbom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fbom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MomsFriendlyDevCo%2Fbom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MomsFriendlyDevCo","download_url":"https://codeload.github.com/MomsFriendlyDevCo/bom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798538,"owners_count":20673901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T20:14:45.005Z","updated_at":"2025-03-27T06:43:48.035Z","avatar_url":"https://github.com/MomsFriendlyDevCo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@momsfriendlydevco/bom\n======================\nTools to pull in, manipulate and cache Australian Bureau of Meteorology (BOM) [Weather Radars](http://www.bom.gov.au/products/IDR663.loop.shtml#skip).\n\n\nRetrieving your local area ID.\n------------------------------\nGo to the [BOM website](http://www.bom.gov.au/catalogue/anon-ftp.shtml) and type in the approximate area name. The code will be listed to the left. For example \"Wollongong\" mid-range radar has the code `IDR032` so supply the ID `032` to retrieve data from this radar.\n\n\nExample\n-------\nCreate an animated Radar image for the Radar over Sydney:\n\n```javascript\nvar Bom = require('@momsfriendlydevco/bom');\n\nnew Bom()\n\t.set('id', '032')\n\t.set('composite.format', 'mp4')\n\t.composite(function(err, path) {\n\t\tconsole.log('MP4 video created at:', path);\n\t})\n```\n\n\nDebugging\n---------\nThis module uses the [Debug NPM](https://github.com/visionmedia/debug) to output debugging information to the console. Simply set `DEBUG=bom` when running whatever upstream library this module is contained in to see debugging information.\n\n\nAPI\n===\n\nBOM (class)\n-----------\nThe main class instance.\n\nConstruct this with optional settings to initialize.\n\n```javascript\nvar bom = new Bom({id: '032'}); // Sydney\n```\n\n\nbom.settings (object)\n---------------------\nObject used to store all settings for this instance. These can be set during the constructor, via calls to `set(key, val)` or directly in this object.\n\nSupported settings:\n\n| Setting                       | Type    | Default                                            | Description                                                                                   |\n|-------------------------------|---------|----------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| `id`                          | Number  | `032`                                              | The ID of the weather radar to use (see the README file for how to retrieve this              |\n| `host`                        | String  | `\"ftp.bom.gov.au\"`                                 | The FTP host to communicate with to retrieve data                                             |\n| `framePath`                   | String  | `\"/anon/gen/radar\"`                                | The path on the FTP host where the radar frames are located                                   |\n| `backgroundsPath`             | String  | `\"/anon/gen/radar_transparencies\"`                 | The path on the FTP host where the background layers are located                              |\n| `cachePath`                   | String  | `\"${os.tmpdir()}/bom-cache\"`                       | Where to locally store cached resources                                                       |\n| `getThreads`                  | Number  | `1`                                                | How many FTP GET operations to support at once                                                |\n| `fetch`                       | Object  | See below                                          | Options for fetching data during a call to `refresh()`                                        |\n| `fetch.frames`                | Boolean | `true`                                             | Whether to attempt to refresh frame data                                                      |\n| `fetch.backgrounds`           | Boolean | `true`                                             | Whether to attempt to refresh background layer data                                           |\n| `backgrounds`                 | Object  | `{background:true,locations:true,topography:true}` | An object specifying which background layers to fetch / render                                |\n| `clean`                       | Object  | See below                                          | Options for cleaning resources                                                                |\n| `clean.olderThan`             | Number  | `60*60*24*1000` (24 hours)                         | The time (in milliseconds) from now which is used to expire resources                         |\n| `composite`                   | Object  | See below                                          | Options for compositing an animated Radar file via `composite()`                              |\n| `composite.autoClean`         | Boolean | `true`                                             | Automatically try to clean out expired radar images, disable if you are calling this manually |\n| `composite.autoRefresh`       | Boolean | `true`                                             | Automatically try to refresh data, disable this if you are calling this manulally             |\n| `composite.cache`             | Boolean | `true`                                             | Attempt to provide the composite radar animation from a local resource instead of generating  |\n| `composite.cacheFileExpiry`   | Number  | `60*60*100` (1 hour)                               | How long the cached version of the composite should be allowed before expiry                  |\n| `composite.cacheFile`         | Function or String  | `IDR{CODE}.composite.{EXT}`            | How to calculate the cache file name                                                          |\n| `composite.delay`             | Number  | `50`                                               | Default delay (in milliseconds) between frames when compositing                               |\n| `composite.format`            | String  | `gif`                                              | An [ImageMagick](https://www.imagemagick.org) compatible multi-image file format to render    |\n| `composite.method`            | String  | `\"path\"`                                           | What to actually return from `composite()`. Can be `\"path\", \"buffer\", \"stream\"`               |\n| `composite.removeAttribution` | Boolean | `false`                                            | Whether to remove the 15px header bar added by the feed. Only set this to true if you are attributing the BOM elsewhere |\n| `composite.arguments`         | Array   | Complex, see source code                           | The operations to perform via ImageMagick to output the composite file                        |\n\n\n\nbom.set(key, value)\n-------------------\nConvenience function to quickly set an option.\nDotted or array notation are both supported.\n\n```javascript\nbom\n\t.set('fetch.frames', true)\n\t.set(['composite', 'format'], 'mp4')\n\t.composite(()=\u003e ...)\n```\n\n\nbom.refresh([options], callback)\n--------------------------------\nAttempt to refresh BOM radar data from the FTP site.\n\nThe callback will be called as `(err, {backgrounds, frames})`.\n\n\nbom.cached([options], callback)\n-------------------------------\nRetrieve the files we have stored locally on disk.\nThis operates the same as bom.refresh() and has the same return but does not connect to the FTP - only using local data.\n\n\nbom.clean([options], callback)\n------------------------------\nCleans out older radar images.\n\nThe callback is called as `(err, arrayOfImagesRemoved)`.\n\n\nbom.composite([options], callback)\n----------------------------------\nCreate a composite image based on the cached data from bom.refresh()\nThis function creates a single GIF / MP4 / Any multi-image file which has a background + animated radar layers.\n\nYou can see a list of compatible multi-image files by running `convert -list format` and searching for any format with '+' in its Mode flags.\n\nThe callback is called as `(err, output)` where output is the format requested in `bom.settings.composite.method` which can be `\"path\"` (default), `\"buffer\"` or `\"stream\"`.\n\n\nbom.utils.nameToDate(path)\n--------------------------\nTranslate a BOM filename into a JavaScript Date.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fbom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomsfriendlydevco%2Fbom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomsfriendlydevco%2Fbom/lists"}