Weather Underground and HTTP/1.1 301 Moved Permanently
itismyworld
Posts: 68
So I've been using weather underground for weather lately and has been pretty nice.
A couple of months I received the above error. They had went to HTTPS from HTTP.
So after some research I found that adding :443 to the end of my host command got everything working again.
A few days ago the error is back and I am stumped!
I send:
SEND_STRING dvCheckWeather, "'GET /cgi-bin/findweather/getForecast?query=60110 HTTP/1.1',13,10"
SEND_STRING dvCheckWeather, "'Host: www.wunderground.com:443',13,10"
SEND_STRING dvCheckWeather, "'Authorization: Basic',13,10"
SEND_STRING dvCheckWeather, "'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.5',13,10"
SEND_STRING dvCheckWeather, "13,10"
and get this:
HTTP/1.1 301 Moved Permanently
Server: Apache/2.2.15 (CentOS)
Pragma: no-cache
Location: https://www.wunderground.com/cgi-bin/findweather/getForecast?query=60110
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 87
Content-Type: text/html
Cache-Control: private, no-cache
Expires: Wed, 04 May 2016 17:15:53 GMT
Date: Wed, 04 May 2016 17:15:53 GMT
Connection: keep-alive
Property-id: drupal-prod
X-RequestSource: AkamaiProdProxy
X-RequestSource: AkamaiDefaultDNA
What am I missing???
A couple of months I received the above error. They had went to HTTPS from HTTP.
So after some research I found that adding :443 to the end of my host command got everything working again.
A few days ago the error is back and I am stumped!
I send:
SEND_STRING dvCheckWeather, "'GET /cgi-bin/findweather/getForecast?query=60110 HTTP/1.1',13,10"
SEND_STRING dvCheckWeather, "'Host: www.wunderground.com:443',13,10"
SEND_STRING dvCheckWeather, "'Authorization: Basic',13,10"
SEND_STRING dvCheckWeather, "'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.5',13,10"
SEND_STRING dvCheckWeather, "13,10"
and get this:
HTTP/1.1 301 Moved Permanently
Server: Apache/2.2.15 (CentOS)
Pragma: no-cache
Location: https://www.wunderground.com/cgi-bin/findweather/getForecast?query=60110
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 87
Content-Type: text/html
Cache-Control: private, no-cache
Expires: Wed, 04 May 2016 17:15:53 GMT
Date: Wed, 04 May 2016 17:15:53 GMT
Connection: keep-alive
Property-id: drupal-prod
X-RequestSource: AkamaiProdProxy
X-RequestSource: AkamaiDefaultDNA
What am I missing???
0
Comments
https://www.wunderground.com/cgi-bin/findweather/getForecast?query=60110
https://www.wunderground.com/cgi-bin/findweather/getForecast?query=60110 HTTP/1.1'
I'd say take off the " HTTP/1.1" at the end of yours and see what happens.
e
HTTP/1.0 400 Bad Request
Server: AkamaiGHost
Mime-Version: 1.0
Content-Type: text/html
Content-Length: 216
Expires: Wed, 04 May 2016 21:02:39 GMT
Date: Wed, 04 May 2016 21:02:39 GMT
Connection: close
<HTML><HEAD>
<TITLE>Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Reference #7.d7a04968.1462395759.0
</BODY>
</HTML>
{
SEND_STRING dvCheckWeather, "'GET /cgi-bin/findweather/getForecast?query=60110',13,10"
SEND_STRING dvCheckWeather, "'Host: www.wunderground.com:443',13,10"
SEND_STRING dvCheckWeather, "'Authorization: Basic',13,10"
SEND_STRING dvCheckWeather, "'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.5',13,10"
SEND_STRING dvCheckWeather, "13,10"
}
Thanks!
Using wunderground might be easier using their direct API that uses HTTP and returns json or XML and the basic info (location lookup, current conditions and 3 day forecast) is free.
https://www.wunderground.com/weather/api/d/docs
http://www.amxforums.com/forum/modpedia-the-public-repository-of-modules-for-everyone/121226-weather-by-zip-code-us-only-from-rss-feed
The host you are specifying has :443 on the end, this leads me to believe you are trying to access the SSL version of the site. That is unlikely to work. The redirect you are getting is their way of telling you they don't want to answer over port 80.
Also, you are specifying "Authorization: Basic" but not sending any login information, either you don't need that header, or you need to include the proper user/password hashes like "Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l"