$tumblr_email, 'password' => $tumblr_password, 'type' => $post_type, 'title' => $post_title, 'body' => $post_body, 'generator' => 'Megatokyo', 'format' => 'html', 'tags' => 'rant', ) ); // Send the POST request (with cURL) $c = curl_init('http://www.tumblr.com/api/write'); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $request_data); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($c); $status = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); // Check for success if ($status == 201) { $info .= "
Successfully posted to Tumblr.
"; adminlog("Post to Tumblr successful. Post id $result", MTS_TUMBLR, MTA_ADD); } else if ($status == 403) { $error .= 'Bad email or password posting to Tumblr.
'; adminlog('Bad email or password posting to Tumblr.', MTS_TUMBLR, MTA_ADD); } else { $error .= "There was an error posting to Tumblr.
"; adminlog("Error posting to Tumblr: $result", MTS_TUMBLR, MTA_ADD); } } ?>