[TxMt] Blogging Bundle / dateCreated

Philip Hofstetter phofstetter at sensational.ch
Fri Mar 23 17:33:54 UTC 2007


Hi there,

today, I was doing the next step in my investigation of why  
TextMate's Blogging Bundle doesn't really work together with  
Serendipity. This time, I was after the strange effect around the  
Date header: Whenever that header is present in the document, it  
causes s9y to set the creation date to the beginning of the epoch.

Aside the fact that it changes the creation date in s9y which is not  
visible anywhere in the tool besides in the sorting order of entries,  
which is a flaw in s9y (it's impossible to change the creation date  
via s9y's interface except by... well creating the entry), this looks  
like a bug in MovableType actually.

Don't ask. Read on.

dateCreated is supposed to be passed around as dateTime.iso8601 which  
in turn is defined as <year><month><day>T<hour>:<minute>:<second>  
(time in GMT). This is what s9y uses and this is what the rest of the  
world uses.

Except MT, that is.

Even though I searched, I found no clear definition of how the date  
must be formated. In one piece of their sample code, I found this  
though:

<member>
   <name>dateCreated</name>
    <value>
      <dateTime.iso8601>
         2005-12-05T21:38:47Z</dateTime.iso8601>
     </value>
</member>

.. which is wrong (note the dashes in the date).

The blogging bundle defaults to the mt-mode and tries to recreate  
this flawed format (parse_post in blogging.rb - I wonder what the  
other T at the end does though) which in turn causes s9y to fail to  
parse the date correctly and set the time stamp to 0 (which isn't  
right thing to do, but I'll report that to their forum).

Manually setting TM_BLOG_MODE to s9y for example fixes the date  
problem, but makes one lose comment-toggling-functionality (the ping  
one currently isn't implemented on s9y's side, but I intend to change  
that with an upcoming patch).

So I created the attached patch bb_s9ydate.diff, which adds a proper  
s9y mode which basically means it makes blogging.rb use the default  
date handling, but still provide the comment-toggling features.

In addition to attaching the patch, I've also uploaded it here:  
http://www.lipfi.ch/bb_s9ydate.diff

Please consider merging this one too as that date-thing sucks in  
particular when using TextMate to edit s9y blogs :-)

Now I'm off to bug the s9y people about the creation date-problem and  
about the support for toggling pings via the RPC-Interface :p


Thanks for your patience with reading this novel here :-)

Philip


-------------- next part --------------
A non-text attachment was scrubbed...
Name: bb_s9ydate.diff
Type: application/octet-stream
Size: 1194 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20070323/13a8c8c6/attachment.diff>
-------------- next part --------------



More information about the textmate mailing list