Git Product home page Git Product logo

Comments (11)

jasonpenny avatar jasonpenny commented on July 20, 2024

Can you give a full example of a script to show the problem (with an example of an actual tumblr)?
(just do not expose your credentials)

from tumblr.php.

 avatar commented on July 20, 2024

for example this api url returns 404 error

https://api.tumblr.com/v2/blog/mel-tedchocolate.tumblr.com/posts?api_key=your_key

from tumblr.php.

oligriffiths avatar oligriffiths commented on July 20, 2024

You need to exchange your_key in that url with your API consumer key.

from tumblr.php.

jasonpenny avatar jasonpenny commented on July 20, 2024

Hey, @AkgunFatih , Oli was just trying to help you. If you don't treat people with more respect, they are not going to want to help fix your problems.


I asked for a full example script (which you did not provide) because I thought you were probably only using the API_KEY, which will not work for non-public tumblr's (like those that redirect to a /dashboard link).

In order to retrieve the posts, you will need to send a fully-signed request by using all 4 OAuth params.

This will not work

list($consumerKey, $consumerSecret, $token, $secret) = [
    '', // fill in these values
    '',
    '',
    '',
];

$client = new Tumblr\API\Client($consumerKey, $consumerSecret);

$blogName = 'mel-tedchocolate.tumblr.com';
$page = 1;

$posts = $client->getBlogPosts(
    $blogName,
    [
        'type'   => 'photo', // or 'text', etc.
        'limit'  => 20,
        'offset' => ($page - 1) * 20,
    ]
);

var_dump($posts);

Changing the client creation line to this should work

$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);

from tumblr.php.

oligriffiths avatar oligriffiths commented on July 20, 2024

This may seem like a silly question, but you are the owner/member of the private blog in question right?

from tumblr.php.

 avatar commented on July 20, 2024

@oligriffiths no but i also tried it with my own blog

from tumblr.php.

oligriffiths avatar oligriffiths commented on July 20, 2024

You won't be able to access a private blog that you are not part of.
If you're happy to supply the name of the private blog you are trying to access, we can look into it.

from tumblr.php.

 avatar commented on July 20, 2024

@oligriffiths the blog for example is mel-tedchocolate
like i said, i also tried it with my own blog

$client = new Tumblr\API\Client($consumerKey, $consumerSecret, $token, $secret);
$client->getBlogPosts('mel-tedchocolate'); // returns 200 

$client->getBlogPosts('mel-tedchocolate', ['type' => 'photo']); // returns 400

from tumblr.php.

jasonpenny avatar jasonpenny commented on July 20, 2024

Is that exact script returning a 400 and not 404?

If I run that script with my credentials, both return status 200 and the data.

400 suggests that the request is invalid in some way, are you using the latest version of tumblr.php and the latest matching versions of the dependencies in composer.json?

from tumblr.php.

 avatar commented on July 20, 2024

@jasonpenny oops sorry its a typo it actualy returns 404

from tumblr.php.

 avatar commented on July 20, 2024

@jasonpenny i invited you to my repo so you can see the full source code if you want

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.