For one of my projects I'm trying to write an external php program that needs to post on a wordpress blog after processing some data. Both php code and wordpress blog are hosted on the same domain and both can have access to the same database. I know that I can write the php code from scratch to write the post directly to wordpress's mysql database but I was wondering if there is such a code already or someone has any better idea to do it (i.e. using wordpress includes and internal functions maybe) ? Thanks in advance
maybe you can use the email to post function in wordpress..to use php to email to a specific email, then wordpress will automatically add a new post depend on the email content.
Thanks, that's a great and easy solution but is there any way to specify different category for each post ?
if you wanna use the wp api's you can try wp_insert_post() which needs to include some wp files ! or if you want to add data without wp api's you have to insert to mysql database directly (with php). codex.wordpress.org/Function_Reference/wp_insert_post