所有,我有以下代码可以从 Tumblr 获取一些帖子:
$baseHostname = "name.tumblr.com";
$tumblrConsumerKey = "asfd"; # use your own consumer key here
$humblr = new Humblr($baseHostname, $tumblrConsumerKey);
$post = $humblr->getPosts(array('limit' => 1));
print_r($post);
这工作正常,并给了我这样的结果:
Array (
[0] => stdClass Object (
[blog_name] => name
[id] => 43993
[post_url] => http://name.tumblr.com/post/43993/
[slug] => slug
[type] => video
[date] => 2013-02-25 18:00:25 GMT
[timestamp] => 1361815225
[state] => published
[format] => html )
我尝试显示一些像这样的值:
echo "The blog name is: ".$post->blog_name;
echo $post->id;
但是,它是空白的。如何显示这些值?
谢谢