Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for WeatherBug API? #27

Closed
jimjeffers opened this issue Oct 31, 2013 · 3 comments
Closed

Support for WeatherBug API? #27

jimjeffers opened this issue Oct 31, 2013 · 3 comments

Comments

@jimjeffers
Copy link
Contributor

Hey there,
I haven't had any issues using the gem with yahoo or google but the gem is consistently crashing when I attempt to use weatherbugs API. My client specifically wants to use weatherbug for their project. Doh!

I am going to submit a pull request for parsing the latitude and longitude. But my question here is regarding the weatherbug API in general. It looks like the API may have changed. In the documentation I was able to find this:

http://i.wxbug.net/REST/SP/getLiveWeatherRSS.aspx?api_key=xxxxx&stationid=<stationid>&UnitType=<UnitType>&OutputType=<OutputType>

However, it looks like the current implementation for weatherbug is possibly calling a deprecated API:

"http://#{@api_code}.api.wxbug.net/getLiveWeatherRSS.aspx"

With the new API I'm uncertain what to supply for the stationID and unit/output types. I'll do further research but we'll most likely need to update the WeatherBugCassette in the spec suite unless I'm missing something. Here is the current implementation's request and access denied response from WeatherBug:

--- !ruby/object:HTTP::Message
http_header: !ruby/object:HTTP::Message::Headers
  http_version: '1.1'
  body_size: 0
  chunked: false
  request_method: GET
  request_uri: !ruby/object:HTTPClient::Util::AddressableURI
    validation_deferred: false
    scheme: http
    normalized_scheme: 
    uri_string: 
    hash: 
    host: [filtered].api.wxbug.net
    authority: 
    normalized_host: 
    path: /getLiveWeatherRSS.aspx
    normalized_path: 
    query: ACode=[filtered]&OutputType=1&UnitType=1&lat=33.4483771&long=-112.0740373
    normalized_query: 
  request_query: 
  request_absolute_uri: 
  status_code: 200
  reason_phrase: OK
  body_type: 
  body_charset: 
  body_date: 
  body_encoding: !ruby/object:Encoding {}
  is_request: false
  header_item:
  - - Cache-Control
    - private
  - - Content-Type
    - text/html; charset=utf-8
  - - Date
    - Thu, 31 Oct 2013 20:27:33 GMT
  - - Server
    - Microsoft-IIS/7.5
  - - Set-Cookie
    - ASP.NET_SessionId=c2cudoyupsh5kwn40c2xecf4; path=/; HttpOnly
  - - X-AspNet-Version
    - 4.0.30319
  - - X-Powered-By
    - ASP.NET
  - - Content-Length
    - '13'
  - - Connection
    - keep-alive
  dumped: false
peer_cert: 
http_body: !ruby/object:HTTP::Message::Body
  body: Access Denied
  size: 0
  positions: 
  chunk_size: 
@gkop
Copy link
Contributor

gkop commented Apr 11, 2014

Fyi, weatherbug shut this API down last week. Their new API is here - http://api-portal.earthnetworks.com/ and there is a free plan available with 15K calls/month at 1 call/second.

@attack
Copy link
Owner

attack commented Apr 11, 2014

thanks @gkop, I will make the change this weekend

@attack
Copy link
Owner

attack commented Apr 13, 2014

moved issue to attack/barometer-weather_bug#1

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

No branches or pull requests

3 participants