get_row("SELECT * FROM wp_posts WHERE ID=".$ID); $dateinfo = getdate(strtotime($postinfo->post_date)); if ($postinfo->ID!=$ID) { echo 'bad postid.'; exit; } $lj_userid = "YOUR_LJ_USERNAME"; //Your LiveJournal username, please replace within quotes $lj_passwd = "YOUR_LJ_PASSWORD"; //Your LiveJournal password, please replace within quotes $lj_method = "LJ.XMLRPC.postevent"; $content = " There is another new entry on my site. Check it out. ".$postinfo->post_title." "; $event = $content; $subject = $postinfo->post_title; $year = $dateinfo['year']; $month = $dateinfo['mon']; $day = $dateinfo['mday']; $hour = $dateinfo['hours']; $minute = $dateinfo['minutes']; $client = new xmlrpc_client("/interface/xmlrpc", "www.livejournal.com", 80); $x_params_r = array( "username" => utf8_encode( $lj_userid ), "password" => utf8_encode( $lj_passwd ), "lineendings" => "pc", "event" => utf8_encode( $event ), "subject" => utf8_encode( $subject ), "year" => utf8_encode( $year ), "mon" => utf8_encode( $month ), "day" => utf8_encode( $day ), "hour" => utf8_encode( $hour ), "min" => utf8_encode( $minute )); $params = array( phpxmlrpc_encode( $x_params_r ) ); $msg = new xmlrpcmsg('LJ.XMLRPC.postevent', $params); $client->setDebug(0); $result = $client->send($msg); if ($result->faultCode() != 0) { print "Couldn't process request: " . $result->faultString(); exit; } echo 'It worked.'; exit; ?>