From mboxrd@z Thu Jan  1 00:00:00 1970
From: Chris Raschl <cr@kautsig.org>
Subject: Re: org-weather for openweathermap.org
Date: Sun, 15 Jun 2014 11:47:11 +0200
Message-ID: <87oaxu1p40.fsf@dylan.nashville>
References: <871turvdom.fsf@dylan.nashville> <87sin7twqg.fsf@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36824)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cr@kautsig.org>) id 1Ww6xi-0005o6-Ix
	for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 05:42:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cr@kautsig.org>) id 1Ww6xd-0008RX-73
	for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 05:42:54 -0400
Received: from static.174.50.47.78.clients.your-server.de
	([78.47.50.174]:55178 helo=mail.kautsig.org)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cr@kautsig.org>) id 1Ww6xd-0008Pb-0q
	for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 05:42:49 -0400
Received: from dylan.nashville (d86-33-197-57.cust.tele2.at [86.33.197.57])
	by mail.kautsig.org (Postfix) with ESMTPSA id 856A91E02E5
	for <emacs-orgmode@gnu.org>; Sun, 15 Jun 2014 11:42:47 +0200 (CEST)
In-reply-to: <87sin7twqg.fsf@gmail.com>
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
To: emacs-orgmode@gnu.org


Hi Thorsten,
first of all, thanks for your suggestions, I really appreciate it.

tjolitz@gmail.com writes:

> Chris Raschl <cr@kautsig.org> writes:
>
>> Hi everybody,
>>
>> recently I wanted to add a weather forecast to my org-agenda. I found
>> org-google-weather, but this package is obsolete since 2012, because t=
he
>> API is not available any more. So I wrote my own version which is back=
ed
>> by the openweathermap.org API.
>>
>> I implemented the minimal usecase which works for me, if somebody else
>> dares to use it, its available here:
>>
>> https://github.com/kautsig/org-weather
>
> Nice, thank you, never made org-google-weather, but this works
> out-of-the-box:
>
>   ,-------------------------------------------------
>   | City:     Weather: light rain, 10.43=C2=B0C - 17.58=C2=B0C
>   `-------------------------------------------------
>
> A few suggestions wrt

[...]

> - why not use (round ...) for the temperature data, 10-17=C2=B0C would =
be
>   more than accurate enough?

I added this. Additionally I removed the temperature unit being
displayed twice, this was unnecessary and looks much nicer in the format
you suggested.

> - why not include city/country info in the weather string? I added
>
>   * Weather
>     :PROPERTIES:
>     :CATEGORY: City
>     :END:
>   %%(org-weather)
>
>   to get the above, but it would be much better to take the return
>   values for city/country and include them in the weather string, to
>   make sure one did not mess up the configuration and gets the weather
>   from another place than expected.

Also thought about this, but I think I will go with the method which was
also used in org-google-weather. It looks like:

* Weather
%%(org-google-weather "New York")

This is much simpler for me, as I'm not so familiar with lisp and the
org-mode api. But I'll have to change the data structure for caching the
data a bit, so it might take a while.

> - maybe make the whole thing a bit customizable by adding a few
>   defcustoms, so the user can decide which info he wants to print in th=
e
>   agenda
>
>   the return string looks like this, there are many options:

[...]

I improved result processing a little bit and added a formatting string
(org-weather-format). You can now also add different temperature fields,
as well as humidity, pressure and wind speed.

Regards,
Chris