Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

get_weather_bulletins() fails #133

Closed
adamhsparks opened this issue Mar 25, 2021 · 6 comments
Closed

get_weather_bulletins() fails #133

adamhsparks opened this issue Mar 25, 2021 · 6 comments
Assignees
Labels

Comments

@adamhsparks
Copy link
Collaborator

adamhsparks commented Mar 25, 2021

@mpadge, do you have any ideas? I've poked around a bit in the functionality here. I can't really determine what's going wrong with it.

I'd post a reprex, but I can't get that to work either. My network connection has issues finding the BOM website and right now it's not finding it. I'll update when I can.

@adamhsparks
Copy link
Collaborator Author

This is using the development version of bomrang where I've used @jonocarroll's USERAGENT switch to be able to access the BOM website through RStudio.

qld_weather <- get_weather_bulletin(state = "QLD", morning = FALSE)
Error: Assigned data `0.1` must be compatible with existing data.Error occurred for column `rain_mm`.
x Can't convert <double> to <character>.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning messages:
1: In r2 == r1 :
  longer object length is not a multiple of shorter object length
2: In r2 == r1 :
 
 Error: Assigned data `0.1` must be compatible with existing data.
ℹ Error occurred for column `rain_mm`.
x Can't convert <double> to <character>.
Run `rlang::last_error()` to see where the error occurred. 

@jonocarroll
Copy link
Collaborator

This looks to be the same as #130 -- 403 blocked due to RStudio UserAgent.

> xml2::read_html("https://www.bom.gov.au")
Error in open.connection(x, "rb") : HTTP error 403.

> op <- options()
> options(HTTPUserAgent = "")
> xml2::read_html("https://www.bom.gov.au")
{html_document}
<html class="no-js">
[1] <head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n<title>HTTPS not supported - Bureau of Meteorology</title>\n<script language="Javas ...
[2] <body onload="start();">\n    <section class="page__container"><header class="header"><div class="header__logo">\n          <svg xmlns="http://www.w3.org/2000/s ...
> options(op)

@adamhsparks
Copy link
Collaborator Author

adamhsparks commented Mar 25, 2021

@jonocarroll, what's the same here? I've used your custom USERAGENT and it accesses the site but I get the error above about longer objects.

Even using your custom string, our network has serious issues finding websites. Using RStudio or a browser, hence my initial post problems.

@jonocarroll
Copy link
Collaborator

Sorry, I was debugging as you posted your update - I initially just got the 403 and thought that might have been the only problem. I haven't looked into the remaining issue.

@adamhsparks
Copy link
Collaborator Author

Our network here is rubbish. I can't get here to GitHub half the time.

@mpadge
Copy link
Collaborator

mpadge commented Mar 25, 2021

I can confirm something is up:

library (bomrang)
x <- get_weather_bulletin (state = "qld")
#> Warning in r2 == r1: longer object length is not a multiple of shorter object
#> length

#> Warning in r2 == r1: longer object length is not a multiple of shorter object
#> length
#> Error: Assigned data `0.1` must be compatible with existing data.
#> ℹ Error occurred for column `rain_mm`.
#> ✖ Can't convert <double> to <character>.

Created on 2021-03-25 by the reprex package (v1.0.0)

I'll check it out now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants