Posts Tagged ‘XmlRpc’

Good christ did that suck.

Monday, July 20th, 2009

I need that opening clip of Samir in Office Space, screaming at his steering wheel having what anyone who has ever sat in traffic knows is a perfectly fucking reasonable temper tantrum.

I’ve just spent the better part of 2 hours banging my head against a desk and playing indiscretely with large sharp objects while trying to get xmlrpc to hit this site.

I’ve done a lot of xmlrpc programming. I know it’s not magic. Google docs works beautifully.

The python code is dead simple. Set about four fields and flip the switch.

I was getting 301s. Of all fucking errors, 301s. “moved permanently.” Checked the logs, nothing.

While LOOKING at the logs, I said “ooh, someone’s banging on my site, can’t have that.” So I blocked the ip address from getting here.

Well…

GUESS WHOSE FUCKING IP ADDRESS I BLOCKED!

That’s right, Freak Boy Wonder managed to lock himself out of his own site. That’s some fine police work there Lou.

I was able to log into the wifi network of an unsuspecting neighbor and fix that particular stroke of brilliance.

I spent 45 minutes following threads of php code through the server side interface (which supports Blogger, metaWeblog, Movable Type, and everyotherdamnthing.)

Pulled down the wordpresslib library, thinking that might exist because of some bizarre peculiarity in the wp host code.

Same thing.

*twitch*

Then I had that moment, that one thought that I can almost rely on when things have gone from black to darker.

“Wouldn’t it be stupid if I needed a trailing forward slash on the filename?”

Now, a file path (on a real OS or online) is “blahblah.com/directory/directory/directory/file” The existence of a “/” means that the preceding is a path. If you’re specifying a file, you don’t need one on the end.

*sigh*

UnLESS you’re calling an xmlrpc server (in wordpress only?)

So yes. It’s all fixeded now.

But I don’t feel any better.

Now on to the FTP code.

date.8601 XMLRPC::Lite perl MetaWeblog

Friday, April 18th, 2008

Good christ this stuff is a headache. Perl has this wonderful module that allows you to build simple xmlrpc clients and servers very easily.

It looks at the structure of your request and figures out by the data type how to map it in to xml by playing data type guessing games.

Unless you pass it a date, which it treats as a string.

Now, xmlrpc has an explicit date type. So if you’re using XMLRPC::Lite to call an api method (for instance metaweblog.newPost) and pass it a date in the request structure (say, in the ‘dateCreated’ or ‘date_created_gmt’ fields), what the server gets isn’t the date field, it’s a string field, even though the contents are the same.

How to force it to call the thing a date I have no idea.
Currently I’m looking at rewriting the damn client in python.

But my eyes keep sliding over to my old (but pretty damn robust) c++ xmlrpc libraries. I could use that to generate a request and, if I was feeling lazy, just pipe the thing into curl or wget.