/* WordPress to MySpace Auto Crossposter v1.0 ------ Author: Roderick Russell email : roderick@roderickrussell.com website: noumenon.roderickrussell.com ------ */ include ("pingmyspace-exec.php"); //START SETTING VARIABLES $dbhost='your.dbhost.com'; $dbname='yourdbname'; $dbuser='yourdbusername'; $dbpass='yourdbpassword'; $myspaceuser='you@youraddress.com'; //MySpace User ID (your email) $myspacepass='yourmyspacepassword'; //MySpace Password $blogUrl='http://your.domainname.com/'; //DON'T FORGET ENDING SLASH $blogName='The Plaintext Name of Your Blog'; //STOP SETTING VARIABLES //CONNECT TO DATABASE SERVER $link = mysql_connect($dbhost, $dbuser, $dbpass); if (!$link) { die('Could not connect: ' . mysql_error()); } //SELECT DATABASE TO USE $db_selected = mysql_select_db($dbname, $link); if (!$db_selected) { die ('Can\'t use foo : ' . mysql_error()); } //EXECUTE QUERY ON TABLE $result = mysql_query("SELECT * FROM wp_posts WHERE post_status='publish' AND post_type='post'"); if (!$result) { die('Invalid query: ' . mysql_error()); } //SET MYSQL ROW $newrow=mysql_num_rows($result) - 1; mysql_data_seek($result, $newrow); //FETCH THAT ROW $row=mysql_fetch_array($result); $title=$row[5]; $content=$row[4]; $postUrl=$blogUrl.$row[12]; $mySubject=$title; mysql_close($link); //the following html really should be replaced with css... but... I'm lazy... $blogContent= "I've posted a new article entitled ".$mySubject." on my blog ".$blogName.".
Due to crossposting and formatting restrictions within the MySpace system, the article will not be posted here.
Please visit ".$blogName." or go directly to the article at:".$postUrl."
Enjoy!"; $myspaceconnect = new myspace; $myspaceconnect->myspaceCreds($myspaceuser, $myspacepass); $myspaceconnect->login(); $myspaceconnect->blogPost($mySubject, $postUrl, $blogContent); $myspaceconnect->close(); ?>