How can I display wordpress post into another CMS

How can I display wordpress post to another site , that is not in wordpress platform?

It is easy to display any part of wordpress content in another platfor site.

For example i have do the following to display recent post into magento CMS.

Just I create a file name showPost in wordpress index folder. and write the following code in it

and this file require form magento site, nothing else.

Finally I get the recent five post from magento.