Note that there are some explanatory texts on larger screens.

plurals
  1. POTumblr API in PHP File structure
    primarykey
    data
    text
    <p>I'm trying to use the Tumblr API (PHP) and I cant seem to get all the required files to load correctly.</p> <p>The Tumblr API can be found here: <a href="https://github.com/tumblr/tumblr.php" rel="nofollow">https://github.com/tumblr/tumblr.php</a></p> <p>First thing I found out is that it doesnt include OAuth, so after some searching I found the files on github and uploaded them to my server.</p> <p>Now it's saying it needs Guzzle. OK, got that uploaded now, but I cant seem to get all the Guzzle files to load up... Example error message:</p> <p><code>Interface 'Guzzle\Common\HasDispatcherInterface' not found in /TumblrTest/Guzzle/Common/AbstractHasDispatcher.php</code></p> <p>There's a <code>HasDispatcherInterface.php</code> file in that path...</p> <p>Do the files need to be in a special order? I tried putting all .php files into a folder, and then using <code>require_once</code> I searched for all *.php files in that folder, but that didnt work... </p> <p>Sorry for a super noob question, any help would be greatly appriciated! Let me know if there's any other info i need to give to help answer this question!</p> <p>-D</p> <p>UPDATE: I still have no idea how the above works, but I found a way around it... I actually think it might be easier then figuring the above out!! The following PHP code does what i need it to do, which is grab the posts of the provided user:</p> <pre><code>$apikey = **[insert api key here]**; $limit = $_POST['limit']; $user = $_POST['user']; $tumblr=$user . ".tumblr.com"; $apidata = json_decode(file_get_contents("http://api.tumblr.com/v2/blog/$tumblr/posts/photo?api_key=$apikey&amp;limit=$limit")); $mypostsdata = $apidata-&gt;response-&gt;posts; $myposts = array(); $j = 0; foreach($mypostsdata as $postdata) { $post["photo_url"] = $postdata-&gt;photos[0]-&gt;original_size-&gt;url; $post["width"] = $postdata-&gt;photos[0]-&gt;original_size-&gt;width; $post["height"] = $postdata-&gt;photos[0]-&gt;original_size-&gt;height; $myposts[$j] = $post; $j++; } echo json_encode($myposts); </code></pre> <p>For some reason I cant get it to pull a list of people i'm following and then get their posts, but oh well...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload