Unable to connect to database at this time.
" ); exit(); // Halts the PHP script } if (! @mysql_select_db($database_name, $database_link) ) { echo( "Unable to locate the database at this time.
" ); exit(); } // select all wordpress posts $sql = "SELECT ID, post_content FROM wp_posts"; $rst = mysql_query($sql); // loop through each post while($row = mysql_fetch_array($rst)) { // get wordpress post id $comment_post_id = $row['ID']; // get commented out blogger post id from content of post $end_id = strpos($row['post_content'], "-->"); $blogger_id = substr($row['post_content'],4,$end_id-4); // fetch haloscan page with comments for the current post $url_to_fetch = "http://www.haloscan.com/comments/" . $haloscan_userid . "/" . $blogger_id . "/"; $url_handle = @fopen($url_to_fetch, "r"); $content = ""; while (! feof($url_handle)) { $content .= fread($url_handle,4096); } fclose($url_handle); // the following code walks through comment html, parsing out comment details hidden in an html comment // using the following haloscan template code (before the {HSCommentEnd}). // note that i didn't import the email address /* */ $last_offset = 0; while (true) { // look for the beginning of a comment $comment_start = strpos($content, "