views:

124

answers:

5

I was unsure as to how to title this question...

Basically, I've downloaded some "Desktop Blog Applications" which is a desktop applications that lets you post to your blog. You get the usual headline/text form and you can add images and stuff.

When using these application, you get to set up your blog settings, your URL, and then tell it what "blog software" your blog uses and then it will use the correct API's for your blog to fetch your blogs, create a new one, edit old ones and so on.

Well, I'm the author of an (PHP) CMS and I'm not utilizing any pre-made blogging framework but have written my own that uses my databases and my ways to handle members, replies, comments and such.

Well, is there ANY way to build a bridge between any of these blog softwares and my software so that I could tell users that they can download "MarsEdit" (for instance) and then point it to url X and set it to blog software Y and then it will just work?

What I need is some form a middle-layer API that I can use to send and receive blog content from and to the users application according to an open and nice/competent blog interface.

Any ideas, or am I not making any sense?

+2  A: 

They probably use the Atom Publishing Protocol. The spec describes the API features you need to implement.

David Dorward
+4  A: 

You should definitely implement a standard XML-RPC API for your CMS. Then, any software compatible with this API will be able to interface your blog.

I suggest implementing MetaWeblog : http://www.xmlrpc.com/metaWeblogApi. It is supported by all the major blogging softwares and websites.

From Wikipedia :

The MetaWeblog API is an application programming interface created by software developer Dave Winer that enables weblog entries to be written, edited, and deleted using web services.

The API is implemented as an XML-RPC web service with three methods whose names describe their function: metaweblog.newPost(), metaweblog.getPost() and metaweblog.editPost(). These methods take arguments that specify the blog author's username and password along with information related to an individual weblog entry.

As said in other answers, the alternative to MetaWeblog is AtomPub (The Atom Publishing Protocol).

IMHO, being more complex and having more features, AtomPub is more complicated to implement. Moreover, I think that MetaWeblog is more widely implemented than AtomPub, and has a crapload of compatible clients.

EDIT: Here a a few implementations examples :

Wookai
This (metaWeblogApi) looks to be a really good suggestion and worth diving further into. It seems so old, though, but I guess blogging hasn't evolved that much since 2003. Do you have any references for how to implement it, nothing complete, just to get me started?
Sandman
Yep, I guess things did not change much ;) ! I added a few links to some implementations. I think that looking at how wordpress does it is a good example (last link, look for `function mw_newPost($args)`).
Wookai
A: 

Have a look at the Movable type API (http://www.sixapart.com/developers/xmlrpc/movable_type_api/) and in general all the APIs supported by WordPress (http://codex.wordpress.org/XML-RPC_Support)

munissor
+1  A: 

Perfect sense, but you need to possibly support a standard, all of these have links to more information, but basically most "mainstream" CMSs I've worked with(drupal, joomla, postnuke, etc) all use xml-rpc and some form of blogger api. Assuming you're proficient in PHP, drupal's codebase is usually pretty easy to walk through for hints and code to reuse.

http://code.google.com/intl/en/apis/blogger/

http://code.blogger.com/

http://codex.wordpress.org/XML-RPC_Support

http://www.sixapart.com/developers/xmlrpc/blogger_api/

http://www.xmlrpc.com/metaWeblogApi

Since you're doing it in PHP, here's a drupal module that could be adapted or reverse engineered to get enough info on the three "main" blog apis that use xml-rpc.

furrymitn
I have downloaded the Drupal module and looking at the code. Given enough time, I should definitely be able to do something with this. But it seems to be using the Blogger API while another poster recommended the metaWeblogApi (which you also linked to), I wonder if that's a problem. I think I could use a howto-guide on this...
Sandman
From http://www.xmlrpc.com/metaWeblogApi, it seems that MetaWeblog was supposed to improve Blogger API, but I guess that it has caught up. I prefer MetaWeblog because I think of it as an open standard, whereas blogger is a specific api of one given blogging platform (that later became kind of a standard). But in the end it doesn't really matter, as both seem to be widely supported.
Wookai
A: 

You can run Fiddler and see exactly what the desktop applications are doing.

SLaks