Skip to content

Instantly share code, notes, and snippets.

@felipem775
Last active May 18, 2017 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipem775/95ce0f9d7b295d247e7f51bfd41748be to your computer and use it in GitHub Desktop.
Save felipem775/95ce0f9d7b295d247e7f51bfd41748be to your computer and use it in GitHub Desktop.
// Return ihwrfhib/bimep/bimep_2017051700.nc
function get_latest(url) {
return fetch(url)
.then(response => response.text()).then(str => (new window.DOMParser()).parseFromString(str, "text/xml"))
.then(function (xml){
return xml.getElementsByName('Latest bimep')[0].attributes['urlPath'].value;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment