title: Tumblr V2 API PHP wrapper
body: <p>I am trying to integrate a Tumblr blog into my website, using the TumblrPHP wrapper available at <a href="https://github.com/gregavola/tumblrPHP" rel="nofollow">https://github.com/gregavola/tumblrPHP</a>. This is code I'm using to view the posts on my site:</p>
  
  <pre><code>&lt;?php
      include ('lib/tumblrPHP.php');
      $consumer = 'key';
      $secret = 'key';
      $tumblr = new Tumblr($consumer, $secret);
      $posts = $tumblr-&gt;get('/blog/nyhetergaius.tumblr.com/posts');
      foreach($posts-&gt;response-&gt;posts as $posts) {
      ?&gt;
          &lt;h2&gt;&lt;?php echo date('Y-m-d', $post-&gt;timestamp) ?&gt;&lt;/h2&gt;
          &lt;?php if ($post['type'] == 'regular') { ?&gt;
          &lt;?php echo $post{'body'}; ?&gt;
            &lt;?php } ?&gt;
          &lt;?php
          if ($post-&gt;type == 'photo') {
              foreach ($post-&gt;photos as $photo) {
                  ?&gt;
                  &lt;img src="&lt;?php echo $photo-&gt;alt_sizes[1]-&gt;url ?&gt;" /&gt;
                  &lt;?php
              }
              echo $post-&gt;caption;
          }
          else
              echo $post-&gt;body;
          ?&gt;
      &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>I am using my own key and secret key, but even so I can only retrieve a default date for each post. What am I doing wrong? Is there an easier way to view the posts as they appear on the blog <a href="http://nyhetergaius.tumblr.com/" rel="nofollow">http://nyhetergaius.tumblr.com/</a>? This is how the posts appear on my site:  <a href="http://test.gaius.nu/om.php" rel="nofollow">http://test.gaius.nu/om.php</a>. </p>
  
  <p>Thank you for your support.</p>