{ by david linsin }

March 28, 2007

plazes API flaw

There is a flaw in the plazes API, when using the method user.trazes. It returns the specified user's whereabouts, grouped by day and ordered ascending by age. I think the ordering is a flaw. The grouping is okay, but I think it should order the plazes descending to tell me that yesterday night I was at home (dave's), today I was at the office (Netpioneer GmbH) and now I'm home again and exactly in that order.

I want to implemented a "last seen" feature for my presence box and with the ordering of the plazes api, I have to implement a lot of logic to get it right. To clarify what I mean a set of sample data:

name | connected | disconnected
Netpioneer GmbH | 20070328T07:36:51 | 20070328T16:43:50
dave's | 20070328T20:16:11 | 20070328T20:33:34
dave's | 20070328T20:37:56 | 20070328T22:01:08
Hauptbahnhof Karlsruhe | 20070328T22:02:59 | 20070328T22:03:31
Netpioneer GmbH | 20070327T07:26:27 | 20070327T16:47:55
dave's | 20070327T18:23:03 | 20070327T23:29:55
Netpioneer GmbH | 20070326T07:28:03 | 20070326T17:46:18
dave's | 20070326T20:53:14 | 20070327T00:01:43

To get my "last seen" location I need to iterate through the set of data comparing dates, which is very messy and ugly! I hope the guys at plazes will implement something like a "last seen" method in the future. Until then I'll have to get messy and hack it myself.

0 comments:


com_channels

  • mail(dlinsin@gmail.com)
  • jabber(dlinsin@gmail.com)
  • skype(dlinsin)

recent_postings

loading...