简体   繁体   English

如何在PHP中使用tumblr API?

[英]How to use tumblr API in PHP?

I am an infrequent user of PHP, but I need to connect to the tumblr api for a client to display their blog posts. 我是PHP的不常使用的用户,但是我需要连接到tumblr api,客户端才能显示其博客文章。

The api takes HTTP GET requests and returns JSON objects, neither of which do I know anything about. api接受HTTP GET请求并返回JSON对象,我都不知道。 I have been trying to mess around with http_get on my localhost but it doesn't seem to be working at all. 我一直在尝试在我的本地主机上弄乱http_get,但它似乎根本没有用。 So my questions are thus: 因此,我的问题是:

1) What is the best method for performing an HTML GET in php? 1)在php中执行HTML GET的最佳方法是什么? 2) Any info at all on using JSON objects, or even better directly related to the tumblr api. 2)关于使用JSON对象的任何信息,甚至更好的与tumblr api直接相关的信息。 Some straight-up code would work wonders in helping me understand, but any advice is welcome 一些简单的代码可以帮助我理解奇迹,但是欢迎任何建议

Thank you 谢谢

When I made my somewhat crufty Tumblr backup script . 当我制作一些有些笨拙的Tumblr备份脚本时 I used a PHP wrapper class for the Tumblr API called php-rest-api . 我为Tumblr API使用了一个PHP包装类 ,称为php-rest-api

This way you can let the wrapping class deal with these aspects of the solution. 这样,您可以让包装类处理解决方案的这些方面。 You can see an example of using the class in my code in the TumblrBackup.php file . 您可以在TumblrBackup.php文件中的代码中看到使用该类的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM