No ScribeFire for now…
Actually I'd been preparing for a new series of posts the last few days, but before I actually start on the first of those a little follow-up is in order.
In Upgrading fun (well…) I mentioned how glad I was having found ScribeFire and getting it to work not only with MyOpera but also with this blog (via the Metaweblog API). Earlier this week, while going through my present and possible new extensions for Firefox, upgrading and adding things, I also upgraded ScribeFire from version 3.1.5 to 3.1.6 — and suddenly ScribeFire started complaining about a "malformed response" from this blog (while happily retrieving all posts from my MyOpera blog).
It got even weirder when Rick Cockrum looked at it for me and reported that on his system, the same version of ScribeFire didn't grumble at all, and he could upload a post with it without any problem. And I noted that ScribeFire had all my tags (as "categories") while it wasn't loading any of my posts. Was there something in my content that caused it to be malformed? But there had been no change in my content between when ScribeFire 3.1.5 worked just fine with my blog and the upgrade to 3.1.6. I tried a Feed Validation Service on this site's Atom feed — not because Metaweblog API uses Atom, but because the feeds also are generated XML and they might give a clue; result: valid feed. Some more chatter in the IRC channel, like:
<rick_c> simplexml manages to properly escape the other characters. i don't know why it can't manage with ampersands
<gsnedders> If it's malformed XML, then we're hitting PHP bugs.
<gsnedders> rick_c: Oh, it does. On some PHP versions on some OSes.
<gsnedders> SimpleXML is horribly broken.
* rick_c stabs PHP
I also tried deactivating the Metaweblog API plugin and reactivating it. It made no difference. I had no idea where else to look and started writing this post. Then, suddenly:
<rick_c> JavaWoman: close out ScribeFire, svn up the metaweblog plugin, then try ScribeFire again.
So I deactivated the plugin again, closed Firefox, fiddled around a bit until I had pulled the latest from the "extras" repository, uploaded it, restarted Firefox, re-activated and re-configured the plugin, and then tried ScribeFire again.
<rick_c> good deal. all i did was escape all special chars in the post text and tags since simplexml can't be relied on to do so properly
Moral? Yes, there is one!
Open Source is great. Open Source also could not exist without re-use of software components: it's the fabric that ties the Open Source world together. But if you include "third party" libraries in your project, you're not just saving time: unless you know that code in detail, you also literally introduce a "foreign" element that may not 100% behave like it would have if you'd written it yourself — which you didn't have time (or the knowledge) for. The same is true for the programming language you use (and the database it talks to, if you use a database as well): those also become part of your project — but who wants to write a web application in assembly language? And the web server? So it helps if you at least understand what that third-party library is doing (even if not in detail) and in what ways it might fail. And what bugs your programming language has (a programming language is software, too). And to get that understanding it helps if you can actually read the code (even if you couldn't write it).
I had a hunch the problem was with "content" somehow causing the API response to ScribeFire being malformed (because the tags were there and the content was not in ScribeFire); Geoffrey Sneddon grumbled about SimpleXML (a PHP extension that Habari uses) being "horribly broken"; and Rick Cockrum silently went away and made sure that in the Metaweblog API things that should be escaped to prevent malformed XML are indeed escaped, never mind what SimpleXML does or doesn't do for that.
And that, in a very small nutshell, is an example how Open Source works.