advogato. You have to edit this file to set your advogato cookie. Author: Andy Wingo Author URI: http://ambient.2y.net/wingo/ */ /* Based on wp-includes/functions.php:pingback, and thus GPL. */ $advogato_cookie = "your-cookie-here"; $export_all = true; // set to true if you want to export all categories $cats_incl = array(); // cat_id's of categories you want to export to advogato $cats_excl = array(); // cat_id's of categories you want to exclude from export to advogato require_once (ABSPATH . WPINC . "/class-xmlrpc.php"); function advogato_crosspost ($post_ID) { global $advogato_cookie, $wpdb, $tablepost2cat; global $cats_incl, $cats_excl, $export_all; $cats_col = $wpdb->get_results(" SELECT category_id FROM $tablepost2cat WHERE post_id = $post_ID "); foreach($cats_col as $cat) $cats[] = $cat->category_id; if (!$export_all && (!array_intersect($cats, $cats_incl) || array_intersect($cats, $cats_excl))) return $post_ID; $postdata = get_postdata ($post_ID); $content = apply_filters ('the_content', $postdata['Content']); $client = new xmlrpc_client ("/XMLRPC", "advogato.org", 80); $message = new xmlrpcmsg ("diary.set", array (new xmlrpcval ($advogato_cookie, 'string'), new xmlrpcval (-1, 'int'), new xmlrpcval ($content, 'string'))); $client->send ($message); return $post_ID; } add_action ('publish_post', 'advogato_crosspost', 8); ?>