What's the best method for sending all new Wordpress Posts to an external script on another server?
It needs to include the full post information including the post content, so a simple ping is not sufficient.
I've looked at how Wordpress Plugins work (without having any past experience) and the publish_post and edit_post actions seemed to be along the right lines, but i've had a few issues with the data being sent not being up to date e.g. edit_post sends a post_id I use get_post() and the data provided is the old data.
The other rather large issue with this is that it would probably require using CURL to send the post to the external server, which not all sites will have access to.
The only other solution I can think of is to attach a function to wp_init() to intercept any requests coming from my server. To clarify this would involve my server requesting the WP index with a custom user agent such as "mysite/1.0". If this custom user agent is detected the plugin would output something itself and then exit preventing the standard WP output.
That way I could use the built in ping service to ping my server from wordpress, get the permalink from this ping and then send a request back to WP which will be intercepted by my plugin and output the post as json.
Does this sound feasible?
Is there another commonly used method to send an entire post to an external script that i'm not aware of?
I'm very new to Wordpress and don't actually use it myself, but i've been asked by people who do use Wordpress how they can get their content automatically imported to my site, so I said i'd look at creating a plugin to do so :)