function api_BlogAPI() { global $blogApiFunctions; if (!array_key_exists('HTTP_RAW_POST_DATA', $GLOBALS)) { XMLRPC::sendFault(1, 'Invalid Method Call'); exit; } $xml = $GLOBALS['HTTP_RAW_POST_DATA']; $blogApiFunctions = array("blogger.getUsersBlogs", "blogger.newPost", "blogger.editPost", "blogger.getTemplate", "blogger.getRecentPosts", "blogger.deletePost", "blogger.getPost", "metaWeblog.newPost", "metaWeblog.getPost", "metaWeblog.getCategories", "metaWeblog.getRecentPosts", "metaWeblog.editPost", "metaWeblog.newMediaObject", "mt.getPostCategories", "mt.setPostCategories", "mt.getCategoryList", "mt.supportedMethods", "mt.publishPost", "mt.getRecentPostTitles"); $xmlrpc = new XMLRPC(); foreach ($blogApiFunctions as $func) { $callback = str_replace(".", "_", $func); $xmlrpc->registerMethod($func, $callback); } $otherMethods = fireEvent('RegisterRpcMethod', array()); foreach ($otherMethods as $func => $callback) { $xmlrpc->registerMethod($func, $callback); } $xmlrpc->receive($xml); }