Shoehorning Drupal's BlogAPI for posting anything but blog nodes? There will be blood.
I’m crunching away on my Live Photo Gallery plugin. It’s little more than two interfaces, a form, and some miscellaneous data classes, so there’s still nothing to show for it. Still, the user interface bits are pretty simple, and the reason I haven’t made much progress is because I’m still trying to figure how best to send the pictures to Drupal and have it set up new nodes based on the pictures. Shame that Drupal’s BlogAPI module is such a lemon.
Here’s how I determined that. My Toastmasters club, Toronto Go-Getters, has a test website right now, where I am trying to use my Drupal skills (both in administering a site and writing modules) to create something that would be useful for any Toastmasters club. I’m using basic story nodes for club news, as well as the Image module package to provide image nodes and a gallery. Because I want to test out my Photo Gallery plugin, and also make writing news easier on me, I enabled BlogAPI and told it to allow access to both image and story nodes. I also made sure that club officer and webmaster accounts would be able to use BlogAPI for these purposes. So good, so far.
Firing up Live Writer, I add a new weblog account for the test site. It goes well, but I never got asked which blog I’d like to use. Odd… I go and grab the RSD document for the test site, and lo and behold, only one blogID shows up. Next, view source. I see in the test site’s <head> block two EditURI links, absolutely identical. There’s my problem! BlogAPI is borken! (Before you can say “Chris, that doesn’t mean that it’s broken,” I can counter by telling you to check the <head> here on coldacid.net. You’ll notice that there’s only one EditURI link, and I only have one node type, blog, set up for BlogAPI. Sometimes a first approximation is all that’s needed.)
Brave idiot that I am, I decide to forge ahead anyway with a test post. After all, nobody’s ever learnt anything by doing nothing at all. The result? A node with no node type. I kid you not. The node type was null. Fortunately, I could still delete it through Live Writer, and I assume I could have through the Content administration panel on the site, too.
Looking through the Image module source, as well, I get the feeling that I’ll not achieve the goal of making it possible to upload to an almost-stock Drupal site. In fact, I might have to write up a whole new module with a custom XML-RPC interface for this purpose.
I'll figure something out. I hope.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=9c6869ae-3ada-498a-9e64-2a96bf89ad2b)

