Extracting information from a webservice

Dirk Hohndel dirk at hohndel.org
Thu Jan 17 08:34:02 PST 2013


Pierre-Yves <pingou at pingoured.fr> writes:

> On Thu, Jan 17, 2013 at 04:24:00PM +0200, Lubomir I. Ivanov wrote:
>> On 17 January 2013 16:20, Pierre-Yves <pingou at pingoured.fr> wrote:
>> >>
>> >> libsoup can be used, which is pretty straight forward...
>> >> http://csoap.sourceforge.net/
>> >
>> > I think this would be a bit overkill (having a doap webservice), the website
>> > store all the information, expose it via it's API, what we need in the client is
>> > simply logic to call a url, load the output and deal with it.
>
>> libcurl + libxml2 then?
>> http://curl.haxx.se/libcurl/c/simple.html
>
> Sounds more like what I have in mind.
>
> I just pushed a change allowing to retrieve someone's dive in xml (documented in
> the /api/).
>
> My idea would be:
> 1) text field in the preferences to set your user id
> 2) button "Sync GPS coordinate from subsurface-webservice"
>   2.1) call the /api/mydives/<user id>/xml/
>   2.2) load the xml returned
>   2.3) for each dive information returned, do some smart date matching to
>   associate the GPS coordinates with the dives already in subsurface.

I pulled the latest from git and restarted.

If I go to api.hohndel.org/api/mydives/<myuser>/xml/

This is what I get (cut off the userid...)

 Aquarium 20.634331014 -156.497194301 2012-12-15 10:11:00 Cabbage+patch 26.2999706268 127.721084595 2012-10-08 10:41:00 Coral+Garden,+Gishiphu+Island 26.2359638214 127.366409302 2012-10-06 12:44:00 Garbanzos+Lair 20.6342663057 -156.497339141 2012-12-15 10:10:00 Gibraltar 36.1185531616 -5.35096406937 2012-11-09 12:37:00 Ginowan+Garden 26.2977266265 127.721336083 2012-10-08 09:05:00 Green+Reef,+Higa+River 26.3604189456 127.734137848 2012-10-07 09:48:00 Hotel+Vessel,+Okinawa 26.3152056606 127.754286518 2012-10-05 11:07:00 Kadina+Mae 26.347328186 127.7395401 2012-10-07 02:07:00 Kuroshima+South 26.2475814819 127.404373169 2012-10-06 10:44:00 La+Herradura 36.7252998352 -3.73605966568 2012-11-08 10:30:00 Paradiso,+Maejima 26.2218088796 127.447788566 2012-10-06 03:12:00 Red+Reef 26.3593559265 127.736663818 2012-10-08 01:31:00 mala+pier 20.8858438069 -156.688383752 2012-12-14 02:36:00 shanty+town 20.7309510978 -156.965660127 2012-12-18 10:05:00 shark+pit 20.8621345041 -156.67578307 2012-12-14 01:23:00 ok

That looks parsable, but not exactly like XML :-)

What am I missing?

/D


More information about the subsurface mailing list