So, in nine years of having a blog, with one exception I've never used another tool to edit my posts with the exception for the back end pages of the blog itself. The exception is a little application that I wrote on my PDA about four or five years ago that allows me to post and edit entries. Now, my PDA is a pain in the arse to get information into, but it can be done, albeit slowly. The problem for me has always been that I needed to be live to make a posting to this system, or I would save it in a text document somewhere and post it later.
Recently, Microsoft brought out a program called Windows Live Writer (WLW) which is basically a WYSIWYG editor for creating posts on a blog system. It was supposedly compliant with all sorts of standards, and it actually looked like a very interesting product. So I downloaded it, and it didn't work of course. My blog system is proprietary, a so-called "Roll Your Own" blog. So yesterday I set about writing an entry point page for WLW to access my blog. It worked, kinda, and there's still some to go. The previous post and this one were created in WLW though, and I'm getting a hold on how it all comes together too. I use an interface schema called the MetaWabLog API to give it access to my system, and it seems to be pretty basic and work up to a point. The point in case being that the documentation on it all is horribly sketchy. For example, the date "Sun, 1 Jan 2007 11:23 AM" should be a legitimate date as far as this program is concerned, but it doesn't seem to work properly. There are a bunch of little niggly things like that that I have yet to sort out.
So the point is, I had to create a non-standard interface to handle it all. It was going to parse the expected input from WLW, using everything I knew to expect from the MetaWebLog API, and give me full control from any external app that uses this interface. Shame it doesn't seem to work. Some bits of it are good, but some are just a pain in the arse. So, I have to have functions that clean up the code and change it so that it fits with my way of doing this. This is nasty, and not the way that things are supposed to be done. Case in point if the function below.
Public Shared Function TextToDBFromLiveWriter(ByVal strText As String)
'strText = ParseWLWImageToXHTML(strText)
strText = Replace(strText, "href="" mce_href=""", "href="" mce_href=""")
strText = Replace(strText, "/imageviewer.aspx?ImageID=", "/imageviewer.aspx?ImageID=")
strText = Replace(strText, "/imageviewer.aspx?ImageID=", "/imageviewer.aspx?ImageID=")
strText = Replace(strText, "&", "&")
strText = Replace(strText, "<br>".ToLower, "<br/>")
strText = Replace(strText, "<p>".ToLower, "")
strText = Replace(strText, "</p>".ToLower, "<br/>")
strText = Replace(strText, "&amp;nbsp; ", "&nbsp; ")
Return strText
End Function
For some reason there's a disparity between code I enter on the page, and code that comes from an application. I'm going to have to fix that...
Now, I don't know about you, but that's not how I think things should be done. And if you go with that logic, then one of two things needs to change. Either the whole world has to change and do it my way, or I'm going to have to change some very basic functionality on this site.