/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php class Tumblr{ /* Tumblr API PHP class by Evan Walsh http://code.evanwalsh.net/Projects/Tumblr */ function read($url,$json = false){ $url = "$url/api/read"; if($json){ $url .= "/json"; } } } else{ $output = "error: cannot fetch file"; } return $output; } function init($email,$password,$generator = "Tumblr PHP class"){ $this->email = $email; $this->password = $password; $this->generator = $generator; } function post($data){ $data["email"] = $this->email; $data["password"] = $this->password; $data["generator"] = $this->generator; if($status == "201"){ return true; } elseif($status == "403"){ return false; } else{ return "error: $return"; } } else{ return "error: cURL not installed"; } } function check($action){ $data["email"] = $this->email; $data["password"] = $this->password; $data["generator"] = $this->generator; $data["action"] = $action; if($status == "200"){ $status = true; } elseif($status == "403" || $status == "400"){ $status = false; } return $status; } else{ return "error: cURL not installed"; } } } } ?>