title: post to tumblr using php
body: <p>Could anyone help me figure out how to post to tumblr using php.
  I tried googling for a library or a sample code but couldn't find one. all I can find is this here <a href="https://github.com/alexdunae/tumblr-php/blob/master/Tumblr.php" rel="nofollow">https://github.com/alexdunae/tumblr-php/blob/master/Tumblr.php</a> and it doesnt seem to work also I looked and tried the code on v1 api at tumblr website that doesnt work either ....</p>
  
  <pre><code> function post($data){
                  if(function_exists("curl_version")){
                          $data["email"] = $this-&gt;email;
                          $data["password"] = $this-&gt;password;
                          $data["generator"] = $this-&gt;generator;
                          $request = http_build_query($data);
                          $c = curl_init('http://www.tumblr.com/api/write');
                          curl_setopt($c,CURLOPT_POST,true);
                          curl_setopt($c,CURLOPT_POSTFIELDS,$request);
                          curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
                          $return = curl_exec($c);
                          $status = curl_getinfo($c,CURLINFO_HTTP_CODE);
                          curl_close($c);
                          if($status == "201"){
                              return true;
                          }
                          elseif($status == "403"){
                              return false;
                          }
                          else{
                              return "error: $return";
                          }
                  }
                  else{
                          return "error: cURL not installed";
                  }
          }
  </code></pre>
  
  <p>Thanks for the help</p>