Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'type' parameter doens't work #69

Open
KhanMaytok opened this issue Apr 21, 2016 · 3 comments
Open

'type' parameter doens't work #69

KhanMaytok opened this issue Apr 21, 2016 · 3 comments
Assignees

Comments

@KhanMaytok
Copy link

The type parameter passed to to an request for post, causes that the 'post' response was a empty array

@markl181
Copy link

can you provide the code you're using?

@KhanMaytok
Copy link
Author

KhanMaytok commented Apr 21, 2016

I'm using the api console provided in the Tumblr API page. I use

// Authenticate via API Key
$client = new Tumblr\API\Client('myhypersecretapi');

// Make the request
$client->getBlogPosts('khanmaytok.tumblr.com', array('type' => 'text', 'tag' => 'galaxy'));

I get

{
  "meta": {
    "status": 200,
    "msg": "OK"
  },
  "response": {
    "blog": {
      "title": "Maytok Blog",
      "name": "khanmaytok",
      "total_posts": 3,
      "posts": 3,
      "url": "http://khanmaytok.tumblr.com/",
      "updated": 1461278736,
      "description": "",
      "is_nsfw": false,
      "ask": false,
      "ask_page_title": "Ask me anything",
      "ask_anon": false,
      "share_likes": true,
      "likes": 6
    },
    "posts": [],
    "total_posts": 1
  }
}

The posts array is empty, but total_post is 1

Then, I erase the type parameter...

// Make the request
$client->getBlogPosts('khanmaytok.tumblr.com', array('tag' => 'galaxy'));

I get

{
  "meta": {
    "status": 200,
    "msg": "OK"
  },
  "response": {
    "blog": {
      "title": "Maytok Blog",
      "name": "khanmaytok",
      "total_posts": 3,
      "posts": 3,
      "url": "http://khanmaytok.tumblr.com/",
      "updated": 1461278736,
      "description": "",
      "is_nsfw": false,
      "ask": false,
      "ask_page_title": "Ask me anything",
      "ask_anon": false,
      "share_likes": true,
      "likes": 6
    },
    "posts": [
      {
        "blog_name": "khanmaytok",
        "id": 143186171980,
        "post_url": "http://khanmaytok.tumblr.com/post/143186171980/caliente",
        "slug": "caliente",
        "type": "text",
        "date": "2016-04-21 22:45:36 GMT",
        "timestamp": 1461278736,
        "state": "published",
        "format": "html",
        "reblog_key": "F9pYN1KX",
        "tags": [
          "maytok",
          "test",
          "galaxy"
        ],
        "short_url": "https://tmblr.co/ZFfKdh25MZvXC",
        "summary": "Caliente",
        "recommended_source": null,
        "recommended_color": null,
        "highlighted": [],
        "note_count": 0,
        "title": "Caliente",
        "body": "<p>Algo está naciendo justo ahora.</p>\n<p data-height=\"400\" data-theme-id=\"light\" data-slug-hash=\"dMevgO\" data-default-tab=\"result\" data-user=\"SakyaStelios\" data-embed-version=\"2\" class=\"codepen\">See the Pen <a href=\"http://codepen.io/SakyaStelios/pen/dMevgO/\">Galaxy</a> by Giancarlo Ventura (<a href=\"http://codepen.io/SakyaStelios\">@SakyaStelios</a>) on <a href=\"http://codepen.io\">CodePen</a>.</p>\n<script async=\"\" src=\"//assets.codepen.io/assets/embed/ei.js\"></script>",
        "reblog": {
          "tree_html": "",
          "comment": "<p><p>Algo está naciendo justo ahora.</p>\n<p data-height=\"400\" data-theme-id=\"light\" data-slug-hash=\"dMevgO\" data-default-tab=\"result\" data-user=\"SakyaStelios\" data-embed-version=\"2\" class=\"codepen\">See the Pen <a href=\"http://codepen.io/SakyaStelios/pen/dMevgO/\">Galaxy</a> by Giancarlo Ventura (<a href=\"http://codepen.io/SakyaStelios\">@SakyaStelios</a>) on <a href=\"http://codepen.io\">CodePen</a>.</p>\n<script async=\"\" src=\"//assets.codepen.io/assets/embed/ei.js\"></script></p>"
        },
        "trail": [
          {
            "blog": {
              "name": "khanmaytok",
              "active": true,
              "theme": {
                "header_full_width": 1080,
                "header_full_height": 720,
                "header_focus_width": 1080,
                "header_focus_height": 607,
                "avatar_shape": "circle",
                "background_color": "#FAFAFA",
                "body_font": "Helvetica Neue",
                "header_bounds": "56,1080,663,0",
                "header_image": "https://secure.static.tumblr.com/e2113e04cd331da27440a47a1d9201e3/dbvrzi8/ZwIo47drg/tumblr_static_b6jsisu9n6og4gcgwg4sgokcg.jpg",
                "header_image_focused": "https://secure.static.tumblr.com/e2113e04cd331da27440a47a1d9201e3/dbvrzi8/gK5o47dri/tumblr_static_tumblr_static_b6jsisu9n6og4gcgwg4sgokcg_focused_v3.jpg",
                "header_image_scaled": "https://secure.static.tumblr.com/e2113e04cd331da27440a47a1d9201e3/dbvrzi8/ZwIo47drg/tumblr_static_b6jsisu9n6og4gcgwg4sgokcg_2048_v2.jpg",
                "header_stretch": true,
                "link_color": "#529ECC",
                "show_avatar": true,
                "show_description": true,
                "show_header_image": true,
                "show_title": true,
                "title_color": "#444444",
                "title_font": "Gibson",
                "title_font_weight": "bold"
              },
              "share_likes": true,
              "share_following": true
            },
            "post": {
              "id": "143186171980"
            },
            "content_raw": "<p><p>Algo está naciendo justo ahora.</p>\n<p data-height=\"400\" data-theme-id=\"light\" data-slug-hash=\"dMevgO\" data-default-tab=\"result\" data-user=\"SakyaStelios\" data-embed-version=\"2\" class=\"codepen\">See the Pen <a href=\"http://codepen.io/SakyaStelios/pen/dMevgO/\">Galaxy</a> by Giancarlo Ventura (<a href=\"http://codepen.io/SakyaStelios\">@SakyaStelios</a>) on <a href=\"http://codepen.io\">CodePen</a>.</p>\n<script async=\"\" src=\"//assets.codepen.io/assets/embed/ei.js\"></script></p>",
            "content": "<p>Algo está naciendo justo ahora.</p>\n<p>See the Pen <a href=\"http://codepen.io/SakyaStelios/pen/dMevgO/\">Galaxy</a> by Giancarlo Ventura (<a href=\"http://codepen.io/SakyaStelios\">@SakyaStelios</a>) on <a href=\"http://codepen.io\">CodePen</a>.</p>\n<p><a href=\"#\"><img src=\"https://secure.assets.tumblr.com/images/inline_placeholder.png\" width=\"18\" height=\"14\"/></a></p>",
            "is_current_item": true,
            "is_root_item": true
          }
        ]
      }
    ],
    "total_posts": 1
  }
}

@ceyko
Copy link
Contributor

ceyko commented Apr 22, 2016

@KhanMaytok I've checked into this a bit and it is indeed an issue on the backend, specifically when requesting text posts along with filtering by tag. I've filed a bug internally and should have a fix shortly.

Good catch, thanks!

@ceyko ceyko self-assigned this Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants