Code Monkey home page Code Monkey logo

Comments (10)

markl181 avatar markl181 commented on July 29, 2024 7

Here's what I did if it helps

  1. Download Tumblr API files and place them in the root of your project
  2. Get a consumer key and secret by registering your application [https://www.tumblr.com/oauth/apps]
  3. Go to https://api.tumblr.com/console/calls/user/info and enter these to get your oauth token and token secret
  4. Ensure you have oauth downloaded (I used [https://github.com/EHER/OAuth/tree/master/src/Eher/OAuth]) and put it in the API folder
  5. Install composer (I used homebrew to do this)
  6. Ensure you have composer.phar and vendor/autoload.php in the root of your project
  7. Create a php file with your $consumerKey, $consumerSecret, $token and $tokenSecret all set as above.
  8. Include vendor/autoload.php, /lib/Tumblr/API/Eher/OAuth/Token.php and /lib/Tumblr/API/Client.php
  9. $client = new Tumblr\API\Client($consumerKey,$consumerSecret,$token,$tokenSecret);

The structure of the returned information doesn't appear to be documented anywhere from what I can tell, so you will probably need to do some digging.

from tumblr.php.

eQX8HNMTU2 avatar eQX8HNMTU2 commented on July 29, 2024 1

@ceyko
I am telling you, I still have win xp :D, on the laptop i'm currently using. Installing software is nearly impossible. I need just some simple php lib I can download and modify und upload on the server.

from tumblr.php.

free-ghz avatar free-ghz commented on July 29, 2024

i agree!

from tumblr.php.

tiagogon avatar tiagogon commented on July 29, 2024

i agree.

from tumblr.php.

markl181 avatar markl181 commented on July 29, 2024

Also if this helps, basic demo of the getBlogPosts method (obviously this example is not very useful just intended for illustration)

$url = 'yoururl';
$posts = $client->getBlogPosts($url, ['type'=>'text', 'notes_info'=>'true']);

foreach ($posts->posts as $post)
{

foreach ($post->notes as $noteAr)
{

    echo $noteAr->type;

}

}

from tumblr.php.

Clararigaud avatar Clararigaud commented on July 29, 2024

Thanks a lot @markl181 !
The structure of the response can be found in the API console by hitting "example output"

from tumblr.php.

eQX8HNMTU2 avatar eQX8HNMTU2 commented on July 29, 2024

@markl181
Is there a way to use the api without installing any composer software or anything. Just downloading the files?
I want a quick reply please

from tumblr.php.

ceyko avatar ceyko commented on July 29, 2024

@AndiHamolli You don't need to have composer on the server your using it on, but it will be a lot easier if you get composer on your local computer first.

Then make a new directory and composer require tumblr/tumblr, which will populate vendor/. You can then copy that vendor director anywhere and after a require_once 'vendor/autoload.php'; in another php file, you'll be able to use, e.g., Tumblr\API\Client.

If you can't even use composer locally, it's going to be more difficult. You'd need to collect all the dependencies manually.

from tumblr.php.

sollidius avatar sollidius commented on July 29, 2024

Depending on the use you could just call the Tumblr API with your API key in the URL.
eg:

This is how I intially coded stuff back in the day @AndiHamolli
Works perfect if you just need to read data. For posting stuff and updating stuff etc you'll need the Oauth solution.

from tumblr.php.

eQX8HNMTU2 avatar eQX8HNMTU2 commented on July 29, 2024

from tumblr.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.