[Goodies-dev] [Bug 14972] met.no sunrise API needs to be updated another time.

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Fri Mar 15 10:37:18 CET 2019


https://bugzilla.xfce.org/show_bug.cgi?id=14972

--- Comment #16 from Olivier Duchateau <duchateau.olivier at gmail.com> ---
(In reply to Andre Miranda from comment #15)
> Olivier, here are my remarks:
> 
> 1 - At update_offset, shouldn't "dt" be unref'ed with g_date_time_unref?

You are right, it is mentioned in g_date_time_new_now and not
g_date_time_new_now_local description.

> 2 - parse_timestring can be simplified, too many returns and if/elses

Feel free to update patch

> 3 - At update_summary_subtitle, date_format is now always the same, any
> reason to keep that if/else?

It is just cosmetic changes. I don't know why with UPower support subtitle is
different.

> 4 - With regards the moon phase, there is the moonphase element under
> astrodata->location->time which is a number, representing: 0..25: "waxing
> crescent", 25..50: "waxing gibbous", 50..75: "waning gibbous", 75..100:
> "waning crescent". No need to use another service, we just need to translate
> that number into (translatable) strings.

Yes, I know, but during my test, with the 1.1 API moonphase was more complete
(first quarter, full moon and so on). Now with the 2.0 API we have only these 4
values.

To get information about moonphase, we must use cgi-bin/event.pl script.

For example, where I live latitude: 44.034928 and longitude=4.996873. I use the
date: 2019-03-28, because moonphase changes.

with the 2.0 API, URL is:
https://api.met.no/weatherapi/sunrise/2.0/?lat=44.034928&lon=4.996873&date=2019-03-28&offset=+01:00&days=2

Moonphase node is:
>moonphase time="2019-03-28T00:00:00+01:00" value="74.285228468" desc="LOCAL MOON STATE * MOON PHASE= 74.3 (waning gibbous)"/

It says "warning gibbous".

If we use cgi-bin/event.pl result is different (eventId is for differents
moonphases):
http://astro.met.no/astro/cgi-bin/event.pl/?debug=1;eventStart=2019-03-15T10:10:10Z;eventSearch=1;eventVal1=44.034928;eventVal2=4.996873;event1Id=210;event2Id=220;event3Id=230;event4Id=240;event5Id=250;

Moonphase is:
> <Event Seq="4" Start="2019-03-15T10:10:10Z" Search="1" reports="1" Id="240" cost="0ms" Val1="44.034928" Val2="4.996873"><Report no="1" time="2019-03-28T04:29:23Z" repId="240" hint="2019/03/28 04:29:23 LAST QUARTER MOON (PHASE=75)"/></Event>

We get "last quarter moon" (it's value is 75).

So I don't think moonphase is revevant.

> 
> > It's just feeling, but I feel like update of icon is very long. For example,
> > this morning night icon still presents whereas sun was already up.
> Strange, did you notice this behavior right after the gtk3 port or just now
> with your changes?

Only with my changes, but it is just feeling.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Goodies-dev mailing list