emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
Cc: Tassilo Horn <tassilo@member.fsf.org>,
	nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: [OT] Icon problem with org-google-weather
Date: Mon, 06 Jun 2011 12:35:45 -0400	[thread overview]
Message-ID: <1113.1307378145@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Nick Dokos <nicholas.dokos@hp.com> of "Mon, 06 Jun 2011 11:40:32 EDT." <593.1307374832@alphaville.dokosmarshall.org>

Nick Dokos <nicholas.dokos@hp.com> wrote:

> Tassilo Horn <tassilo@member.fsf.org> 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

  reply	other threads:[~2011-06-06 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-06  0:27 [OT] Icon problem with org-google-weather Nick Dokos
2011-06-06  7:38 ` Tassilo Horn
2011-06-06 13:51   ` Nick Dokos
2011-06-06 15:27     ` Tassilo Horn
2011-06-06 15:40       ` Nick Dokos
2011-06-06 16:35         ` Nick Dokos [this message]
2011-06-07  4:53 ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1113.1307378145@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tassilo@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).