Tumblr API包装器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tumblr API包装器相关的知识,希望对你有一定的参考价值。
<?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"; } } } } ?>
以上是关于Tumblr API包装器的主要内容,如果未能解决你的问题,请参考以下文章
为 Javascript API 创建飞镖包装器的好方法是啥?