$values["tags"] = $itemTags; // now lets post this up $curl = curl_init('posterous.com/api/newpost'); curl_setopt($curl, CURLOPT_USERPWD, IMPORT_SITE_EMAIL . ':' . IMPORT_SITE_PASSWORD); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $values); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_exec($curl); curl_close($curl); // now update the item in the database and set it's status to 'moved' so that it doesn't appear in our queue again $update = array("item_status" => "moved"); $db->updateById("items", $update, "ID", $obj->ID); $currentRecord++; $totalRecsProcessed++; echo "Finished batch. Total Records: " . $totalRecsProcessed . " Waiting 3 seconds until next batch.<br/>"; ob_flush(); sleep(3); } $items->close(); ob_clean(); } if ($totalRecsProcessed == 0) { echo "Apparently you don't interact with the web much so how exactly did you come up on this script?"; } ob_end_flush(); ?> </body>