Archive for March, 2010

Wordpress and XML-RPC

What is XML-RPC? Stripping all the technological detail away, it is merely a specific way of requesting data and getting a response back. It uses xml to make the request and sends and receives the data over http. (A more technical discussion can be found here.)

I’m currently working on a project that needs to get data from a WordPress installation. Fortunately, WordPress provides an XML-RPC interface which includes several stock APIs as well as a WordPress specific API. This is far more efficient than using custom templates or parsing actual html pages for both sides of the transaction.

With all that said, how do you use it? Depending on what you are trying to do and the platform you are using, there should (hopefully) be a nice library already coded so you can worry about requesting and receiving data without fretting about the details of xml-rpc. However, sometimes a q&d (quick and dirty) script is useful to test a request and look at what is actually coming back. I do that using a simple php script:
Read the rest of this entry »

Yet Another Marketplace

We started with the iPhone App Store, added the Android Marketplace and now Google announces a new one: The Google App Marketplace. These apps will be part of Google’s cloud (think Google Docs).

So much to learn, so little time. (At least for us independent developers.)

Wikipedia…

Wikipedia topics are usually dominated by the fanatic with the most time to spare, which is why I don’t rely on Wikipedia when the matter is both controversial and important.

Jerry Pournelle

Android App Idea

Since getting an Android phone, I’ve been installing (and uninstalling) lots of different apps. The creativity and variety is fantastic and the way the phone works with Google maps is incredible. But I still haven’t found the app I’m looking for.

I’m a backpacker and although GPS is a wonderful thing, you really need to couple it with a set of good Topo maps to make it useful when you are on the trail. Oh, and no cell service – the maps have to be locally stored on the device. Getting maps is not difficult – the USGS offers free downloads of the entire US (download here). These are extremely high quality maps which also makes them very large files – some approach 15MB for a single 7.5 minute square.

The app I want uses the phone’s GPS to show me where I am on a USGS Topo map. It should be able to zoom in and out (within reason) and it should not kill the phones memory, which means smaller map segments tiled in the same way the Google maps does.

Right now I’m just sketching out ideas on how to pull it off. Oh and I guess I should finish learning how to program in Android too.

Migrating From TypePad – Images

Migrating from TypePad isn’t too difficult – they provide the standard MT export file, which most platforms readily accept. The one big challenge my latest migration project involved was getting the images out. Since the client is a domain user, their images hosted at TypePad will stop working once the domain is switched over and there is no way in the TypePad control panel to export them.

The solution I came up with was to use php on the new destination (a dedicated server) and parse the export file itself, denoting when I’m in a body section, and using a regular expression to try and find any image tags that point to the domain being relocated. For each TypePad hosted image that was found, the same directory structure was created locally, and then the file was copied from the TypePad server to the local matching directory structure.

It took quite a while to run, since the client had been on TypePad since 2004, but the result was wonderful – all I have to do is relocate the created directory to the webspace and not only have all the images been released from they TypePad prison, but all the existing links will still work correctly. The one caveat is that the base image directory started with a period, which is not a problem as long as you understand that Unix variants hide all files and folders that start with a period. Use ls -la to see what is normally hidden.

Code is below the fold… Read the rest of this entry »

Blogging again…

It has been a few years since I blogged over at king-of-fools.com.  I didn’t stop because I ran out of energy or passion, just time.  The past few years, I’ve been doing so much blog related support and development (not to mention the day job, family, and church)  that there was simply no time at all left for anything else.

The load has not lightened at all, but I miss journaling and thought this would be a nice place to at least track how I solved a problem in the past, hoping that will help in the future.  It should also be a nice medium for sharing technical answers that might help others, just as I glean so much know-how from the blogs and forums of others.

Ed