[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [OT] Icon problem with org-google-weather
From: |
Nick Dokos |
Subject: |
Re: [O] [OT] Icon problem with org-google-weather |
Date: |
Mon, 06 Jun 2011 12:35:45 -0400 |
Nick Dokos <address@hidden> wrote:
> Tassilo Horn <address@hidden> wrote:
> > It's already there. But now I get
> >
> > (error "Bad url: :/ig/images/weather/chance_of_storm.gif")
> >
> > in the first `org-google-weather' call.
> >
>
> Me too: this is recent - the image URLs were of the form g0.static (or
> something like this) yesterday - but it seems that Google is playing games:
>
> when I visit https://www.google.com/ig/api?weather=Boston through a browser,
> I get <icon data="/ig/images/weather/partly_cloudy.gif"/> in the returned XML.
>
Here's a quick-and-dirty hack to work around Google's inability to make
up its mind about what it will return: a path or a complete URL? The
hack assumes that the value-du-jour is a path, so if tomorrow Google changes
its mind, you may have to revert:
diff --git a/google-weather.el b/google-weather.el
index fad9ed7..f59b1bf 100644
--- a/google-weather.el
+++ b/google-weather.el
@@ -172,7 +172,7 @@ See `google-weather-retrieve-data' for the use of
EXPIRE-TIME."
`(,forecast-encoded-date
(low ,(google-weather-assoc 'low forecast))
(high ,(google-weather-assoc 'high forecast))
- (icon ,(google-weather-assoc 'icon forecast))
+ (icon ,(concat "https://www.google.com" (google-weather-assoc 'icon
forecast)))
(condition ,(google-weather-assoc 'condition forecast)))))
(loop for entry in (google-weather-data->weather data)
when (eq (car entry) 'forecast_conditions)
With this, I get the usual 4-day org-google-weather forecast in my agenda,
except that cached images still don't work.
Nick
Re: [O] [OT] Icon problem with org-google-weather, Nick Dokos, 2011/06/07