Use teh WP_Query
Plugin API support for creating / updating posts