Atompub Example File

This is an example atom upload that I'm just testing out. Comments are stripped, so the following wordpress "more" separator is removed

<!--more-->

To load this via AtomPub I use cURL, which has a little bit of a strange interface, but it works. The primary section in this file is <content>, which contains the actual post in XHTML.

The rough source for this post can be found in a PDF doc here. You can hack it up for your site and try out atompub. I have done some editting on file to reference it on the WordPress Codex after I uploaded the PDF, thus this file and the PDF are not exactly the same.

See XHTML Entities for those characters that cannot be used in the content body. Generally, it's just &, >, < and ". Everything else seems to be okay.

For some reason wordpress handles newlines like a <br/> so that's a little tricky. I need to figure out a way for wordpress to eat newlines.

  • To add a new post do:

    curl -v -k -u 'user:pass' -H "Content-Type: application/atom+xml" -T "atom-example.xml" https://www.turvene.net/wp/wp-app.php/posts
  • To update the current post do:

    curl -v -k -u 'user:pass' -H "Content-Type: application/atom+xml" -X PUT -T "atom-example.xml" https://www.turvene.net/wp/wp-app.php/post/<postid>
  • To retrieve the post do:

    curl -v -k -u 'user:pass' https://www.mysite/wp/wp-app.php/post/<postid>

Also, I'm trying to figure out how to format some of the XHTML codes to what I want.
An example using <pre> where <code> ain't
so great:

     main() {
       printf("this is a code fragment");

       // C comment statment
       // Another
     }

I can always change the CSS for these to do what I want when I create my own theme. That's on my todo list.

I wanted to add the XML source for this file as an attachment but it was difficult. I had to
convert the file to either Openoffice ODT, M$ doc or PDF format and then link to it
here. But first I had to figure out the link URI for the attachment, which was a little tricky.

The alternative was to use the The WordPress Editor, with which I'm not that happy. Once one edits a post via the WP editor, it is very difficult to update the post using atompub.

So I used atompub to add the link ref above, One can use the post permalink from the site, or the postid. One interesting note is the link can be relative so the whole http://www.turvene.net/wp can be discarded. That's kind of nice.

Posted in System Admin | 1 Comment

RR: Savageman 2010

This is the race report from my Savagemen Half Iron-distance triathlon 2010 event. It’s a great, but humbling, experience. Continue reading
Posted in Athletics | Leave a comment

Using the Atom Publishing Protocol in WordPress

After getting more comfortable with WordPress (See The WordPress Post Editor Is Limited, I started looking at mechanisms to make posting/post updates even easier. I first started writing my own importer based on the Atom Publishing Protocol. And then, much to my delight, looked at a little file called wp-app.php which has the comment Atom Publishing Protocol support for WordPress. Wouldn’t it be great if this did what I want?

Continue reading
Posted in Documentation, Software Tools, System Admin | Tagged | Leave a comment

The WordPress Post Editor Is Limited

I’m getting to like WordPress. It requires a minimal learning curve and comes with a butt-load of extensions, templates and upgrade features. But one thing I really don’t like is trying to write lengthy posts in the WordPress Editor It’s okay for small posts but doesn’t have the features I’m used to for longer posts. So, with it, I end up spending time formatting and proofreading content rather than creating it. Okay, to be fair, proofreading is something I still have to do but it just seems easier in a familiar environment.

Continue reading
Posted in Documentation, Social Networking, Software Tools | Tagged | 1 Comment

Stolen Redline – New Fuji ‘cross bike

This is a story about loving a bike, loosing it and then getting a replacement that works okay, but just isn’t the same.

Continue reading

Posted in Athletics | Tagged | Leave a comment

RR: 2010 Ironman Saint George

This is my race report for the Ironman Saint George event with my friends and co-triathletes, Jay Stanley and Will Colston.

Continue reading

Posted in Athletics | Tagged | Leave a comment

Redline Conquest Pro ‘Cross Bike

I finally selected a good cyclocross bike for my all-purpose needs by monitoring ebay for a couple days and reading reviews on possible bikes. My original plan was to purchase a used cyclocross bike with fat tires and then buy a second wheelset with road tires. The fat tires would be for every day commuting in varying terrain. I could switch to the second wheelset for long rides.

Continue reading

Posted in Athletics | Tagged | Leave a comment

Selling my Orbea

In executing my master plan to sell my commuter and beater bikes and then buy a cyclocross bike, I have taken step one by cleaning up my Orbea Zonal and listing it on craigslist. The weird thing I find about bikes is, in buying a used one, the price always seems high. But in selling one, I added up all the crap I bought for it and I can’t believe I’m listing it for THAT low.

Continue reading

Posted in Athletics | Tagged | Leave a comment

Starting WordPress Blog

Well, I got fed-up with maintaining a blogging product on my company website (see FOSS products) and decided to look around for alternatives. A lot (a great big bunch) of people are using WordPress for their personal blog page. In fact one of the big Google architects, Matt Cutts uses it for his personal blog. So I’m trying it.

And here’s how…
Continue reading

Posted in Software Tools, System Admin | Tagged | Leave a comment

RR: 2008 Beach2Battleship Iron Distance Race

This is my race report for the 2008 Beach-2-Battleship Iron Distance triathlon event I did with my friends and co-triathletes Jay Stanley and Erik Van De Meulebroecke. For an alternative view see Jay’s race report. Continue reading
Posted in Athletics | Tagged | Leave a comment