Adding Custom Fields to an Existing Post via XMLRPC in WordPress

If you’re having difficulty adding custom fields to an existing WordPress posts via XMLRPC’s metaWeblog.EditPost command, try including a dummy entry in your code.

It worked for me.

I’m working on a project where we’re programmatically adding WordPress custom field data to thousands of posts, seemed like a great job for XMLRPC. I had assumed a simple Ruby call like this would work:


result = server.call('metaWeblog.editPost', wordpress_post_id, name, pass, {"custom_fields" => [{"key" => "note", "value" => "loves you"]})

It doesn’t – it gives a less than happy Error 500 ‘Sorry, your entry could not be edited. Something wrong happened.’

I read through WordPress’s xmlrpc.php file and noticed that the update post command is run (line 2460) before any of the custom field data is recognized (line 2476).

So, I added a line to not change the Post’s title, and new custom fields were added as expected.


result = server.call('metaWeblog.editPost', wordpress_post_id, name, pass, {"title" => POST_TITLE, "custom_fields" => [{"key" => "note", "value" => "loves you"]})

Real Time Red Herring

Over the past few years, I’ve worked on a number of projects exploring the the value of capturing & sharing a fleeting moment in ‘real time’.

These projects included;

  • Cullect; which proved to me how infrequently ‘real time’ ever passed into ‘relevant’.
  • RE07.US; which was a URL shortener that self-destructed after 5 minutes
  • iTunes-to-Twitter; where I continually sent my iTunes playlist into Twitter to no one’s enjoyment.

While these efforts hinted at the uselessness and annoyance in focusing on ‘real time’ for goofy side projects. I needed to find out if there was significant business value in focussing on ‘real time’.

So, I landed a project with a client in an industry I assumed would convincingly show me the need to focusing-heavily on ‘real time’ message delivery and communication.

In a round of customer interviews, I asked – “how frequently do you want to know the status of X?”

“90% of the time, within 4 hours.”

Turns out, more than 90% of the time – everything is work as expected. That remaining 10%, when additional coordination is needed – the parties involved pick up the phone and talk to one another in real time. And that was the constituents who looked at the data most frequently.

In my email today, I received a ‘Thank you, I needed that.’ for a message I sent 2 months ago. The message referenced a podcast I recorded 4 years ago. The podcast was a retelling of an experience I had 8 years ago. An experience about patiently waiting for the right moment.

All this makes me wonder when Google will stop indexing the ‘real time’ web [1] in the name of spam-prevention and focus their attention on the under-appreciated “I’m Feeling Lucky” button.

This pursuit of ‘real time’ is a distraction. A distraction from building and sharing relevance and timelessness. A distraction from being present.

Elsewhere:

“The breaking news mindset isn’t just annoying, it may be distracting you from what really matters.” – Seth Godin

1. I’m holding on my prediction that by March 2011, Twitter – the company – is no longer relevant.

What Does a Successful MN Tech Firm Look Like?

“The region has just a few large tech operations left (Lawson, Digital River, Seagate), and venture capitalists say most local software startups are tiny and will never grow into market leaders or large companies.” – Dan Haugen.

Most businesses, local or otherwise, are tiny and will never grow to market leaders or large companies. Minneapolis’ thriving restaurant, music, and art scenes immediately come to mind. Not to mention – my 2 favorite auto repair shops aren’t owned by large companies (though – they are market leaders within this 10 block radius).

I don’t hear many stories of restauranteurs struggling to get venture capital funding for their newest dining concept. Nor do I hear similar cries from other ‘industries’. Yet, the local zeitgeist in the web tech community defaults to getting early stage funding for ideas that aren’t capital-intensive or significantly innovative at a changing-the-world level (changing-our-world level: yes, that’s entirely different) [1].

“But not all industries are as capital efficient as the Web or Information Technology. Biotech, medical devices, semiconductors, communications and CleanTech require significantly more capital to build and scale before they can generate profits. It’s in these industries that the lack of a public market has taken the heaviest toll on entrepreneurs and their startups.” – Steven Blank

Re-read that statement from Blank. His list of industries hurt by the non-existant IPO market is a list of all the industries Minnesota is, or wants to be, known for.

From this angle – the acquisition of ADC Telecom is a success story. They beat the odds. Minnesota’s tech community should be celebrating. ADC found a $1.25b exit in a tough market.

Congrats.

In a world where IPOs and acquisitions are non-existant, the question isn’t – what local entity will grow to fill ADC’s shoes (assuming it vanishes from MN’s landscape)?. The question is – What does our tech community look like where everyone…

“…can find 2,000 people to pay … $40 a month for a product … make $1 million a year. The economics of that are liberating. When I can build a company that costs nothing to operate, that changes the way I can live” – Dan Grigsby

Grigsby paints a very compelling vision of Minnesota entrepreneurship. A vision less reliant on state policies, big funding, and big exits and more on a sale-able product to a global market. A vision that resonates with me, and I suspect many of you.

P.S. There’s been chatter over on Minnov8 on this topic as well, where Minnesota’s ‘risk-adverse’ culture (as compared to where?) is brought up as a negative.

If anything, it’s a list of positives.

If you want to have it all; raise a family, bootstrap startups while making a living contracting and consulting – Minnesota is the perfect place.

I’ve had enough conversations with people that have moved elsewhere to get funding for their company, find developers, and build businesses to know – it’s not any easier anywhere else. No place guarantees success.

1. The most recent example comes from Gene Rebeck, Twin Cities Business Senior Editor
“But one thing’s for sure: Start-ups are going to need access to capital.”

RESTful Blogging via Email w/ Sinatra?

Somewhere in my travels I thought I saw a project that uses Sinatra and some very RESTful URLs to do blogging via email. Now I can’t find it.

If you’ve seen this as well – leave a message in the comments.

If I can’t find it in a couple of days, I think I know what my next project is.

🙂

Update 13 Dec 2010
Anil Dash asked for something like this almost 8(!!!!) years ago.

Twitter’s a Memory Hole

“…it was an automatic action to lift the flap of the nearest memory hole and drop it in, whereupon it would be whirled away on a current of warm air to the enormous furnaces which were hidden somewhere in the recesses of the building.” – George Orwell, Nineteen Eighty-Four

This weekend, I opened up my Twitter account and read each message I had posted.

Then I deleted it.

And I kept reading and deleting until Twitter stopped showing me my messages – sometime around October 2009.

I started with more than 7200 ‘tweets’ and according to Twitter, I’ve 6,587 remaining.

Now if you visit /garrickvanburen you won’t see any of them. Seems as though Twitter has decided that anything I’ve written prior to, say, October 2009 is no longer available [1]. But – if my profile says I have 6,587 ‘tweets’ – where are they?

I even searched for them via search.twitter.com;

” Older tweets are temporarily unavailable.”

If they’re not accessible – shouldn’t the number be 0?

I’m completely fine with Twitter being temporary. I think it should be (that’s why I mass deleted them anyway). I don’t think Twitter should be indexed by Google or Bing or any other service. The question is – how long should a give ‘tweet’ be accessible?

Nine months seems as arbitrary as 140 character limit and killing off basic auth in August.

So, how long should a ‘tweet’ live?

If Twitter’s goal is to capture the zeitgeist in real-time, how long does it take for a moment to pass?

5 minutes? 1 hour? 24 hours? 1 beat?

Update 25 June 2010: As of this morning, my Twitter account reads ‘0 tweets’. Makes me feel that Twitter doesn’t see any value in keeping the old stuff around and accessible. Feels very Logan’s Run. Not sure how I feel about this yet.

Facebook is the Future of Television

“But in the meantime the Net’s going to look way too much like the last days of TV. Which it will be.” – Doc Searls

This morning, I heard a broadcast radio discussion on the future of television .

First off – the host made the assumption that cable television is some sort of necessity. Wow, if that’s the case – we’re living in the age of abundance.

Second off – I’m listening to this on the radio.

Isn’t that kinda like BP discussing the future of rail?

Either way.

In my household, chances are there’s a Facebook window open more often than a TV is on or a radio is on.

Facebook is compelling for all the reasons TV wants to be. Unfortunately – TV has a lot more work to do to make me care about characters. My Facebook (and I’m sure yours as well) is already filled with people I actually care about. People that impact my daily life directly – outside of Facebook.

The gulf between the stories, concerns, and issues my people and those broadcast TV, radio, or newspaper are publishing is wide, and growing.

It’s as easy to spend your cognitive surplus watching Facebook auto-update as it is watching the latest ultraviolent television production (broadcast or cable).

I haven’t even mentioned Facebook’s video support yet. 🙂

Update: Then there’s the bit about considering maintaining Facebook activity a part-time job in the same way TV is. 🙂

Second Guessing Social Media Buttons

“What if I had put Myspace links on, or Digg links on my stories in 2005? When you go back through the archive those would seem crazy, almost defacing of the content. Don’t those things belong in toolbars or bookmarklets?” – Dave Winer

And that’s just one problem with the proliferation of ‘twitter this’, ‘Facebook like this’, etc buttons.

  • The problem from the visitors’ perspective;
    Either I know what the logos and links mean for those services mean or – I don’t. If I know what they mean – I’ve got a bookmarklet or other mechanism that I’m comfortable using (you know for all the other sites on the internet without the logos). If I don’t know what they mean…um…is this a conversation the website publisher wants to have?
  • The problem from the website publishers’ perspective;
    It’s either free advertising or a complete distraction from the website publisher’s core offering. Worse, it assumes the website publisher knows the services its best customers prefer. In my experience, customer preferences move faster than website refresh schedules – so by the time the ‘Facebook Like’ button is integrated in a useful manner – the visitors changed their preference.

Yes, this is a refresh of the “The Problem with Badges” essay I wrote in 2006.

Good Bye Neon. Thank You.

Moments ago, the tow truck from New Gate School dragged away our 13 year old Dodge Neon. This is the car Jen and I bought days before we were married and was our only car for 9 years.

Moving across 3 states. At least 1 cross-country drive. More iPod adapters than I can remember.

Cleaning the glove compartment was like high-speed review of all those years – through proof-of-insurance cards, garage receipts, and cassette tapes.

Three years ago (almost to the day) I asked, Which Car Should I Buy?. That was when our – then 10 year old – Dodge Neon had just surpassed the threshold where anything other the regular maintenance was no longer worth the investment [1].

When I originally asked about a a new car – I was envisioning a vehicle; equally compact, fun, distinctive, and with as much life in it. Something like a Cooper Mini, a VW Rabbit, or a Audi A3. But I asked you, because nothing called out ‘buy me’. What I didn’t anticipate 3 years ago was needing to fit 3 car seats in the PT Cruiser.

This week, we picked up the Neon’s replacement: a 2010 Dodge Grand Caravan.

While it doesn’t fit all the criteria I originally outlined – it hits quite a few.

Plus one more I didn’t expect back then.


1. Shortly after this, it surpassed the point where regular maintenance was also no longer worth it. Issues left for the students at New Gate; dead starter, dent in rear fender, oil leak, missing hub cap, broken tail light, froze up rear brakes.

Shortly Over Part 2: Twitter Returns Long URLs

After maintaining years of awkward, inconsistent URL shortening behavior because of some vague argument about SMS capabilities – Twitter has announced links passed through their service may or may not be shortened to t.co.

“A really long link such as http://www.amazon.com/Delivering-Happiness-Profits-Passion-Purpose/dp/0446563048 might be wrapped as http://t.co/DRo0trj for display on SMS, but it could be displayed to web or application users as amazon.com/Delivering- or as the whole URL or page title. Ultimately, we want to display links in a way that removes the obscurity of shortened link and lets you know where a link will take you.”

This is a win for the casual users of Twitter that still send & receive URLs through the service.

Shortly Over Part 1