Divelogs.de integration

Rainer Mohr mail at divelogs.de
Sat Nov 16 04:26:12 UTC 2013


Hi Thiago,

Am 15.11.13 20:10, schrieb Dirk Hohndel:
> To get a list of available dives in XML format, POST to 
> https://divelogs.de/xml_available_dives.php Parameters: "user" 
> (mandatory) with your username "pass" (mandatory) with your password
> Returns:XML
>
> What is the format of that XML?
The Root Node is <DiveDateReader>
It is followed by <Login> which can contain the value "failed" or 
"succeeded".

So a failed login is always like this:

<DiveDateReader version="1.0">
     <Login>failed</Login>
</DiveDateReader>

If the login succeeds, you will get the node <DiveDates> as second child 
of  <DiveDateReader> which contains <date> nodes for each dive. Value is 
the dive's date and time. Unfortunately, I chose a stupid date format 
back when I wrote it: dd.mm.YYYY hh:mm instead of YYYY-mm-dd hh:mm - 
sorry about that, as this is already used by Diving Log 5.0 I probably 
can't change that now :-(

Attributes of the <dive> node are the divelogsId (INT) and the 
lastModified date (this time in proper format - added that later - duh!)

If it helps, I can add another optional parameter to the POST that gives 
you both dates in YYYY-mm-dd.

Here's an example:

<DiveDateReader version="1.0">
     <Login>succeeded</Login>
     <DiveDates>
         <date divelogsId="45746" lastModified="2006-10-09 
22:00:00">02.08.2001 10:30</date>
         <date divelogsId="45747" lastModified="2006-10-09 
22:00:00">02.08.2001 14:00</date>
         <date divelogsId="45748" lastModified="2006-10-09 
22:00:00">03.08.2001 09:00</date>
         <date divelogsId="45749" lastModified="2006-10-09 
22:00:00">03.08.2001 11:00</date>
         <date divelogsId="45750" lastModified="2006-10-09 
22:00:00">22.08.2001 10:00</date>
     </DiveDates>
</DiveDateReader>

You can use the date (value) to check if a dive already exists and skip 
it in the next step.

Then eiter POST "user" and "pass" to 
https://divelogs.de/DivelogsDirectExport.php to get all dives in DLD 
format or add an additional "ids" with comma separated divelogsId from 
the XML described above to get only the ones you want. I suppose the 
parsing of the DLD is already completely in place.

Let me know if you need any further information.

regards,
Rainer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20131116/06dddc01/attachment.html>


More information about the subsurface mailing list