Tagged Pagination Quirk/Bug

93 views
Skip to first unread message

Grant Ullman

unread,
Jun 7, 2013, 6:26:56 PM6/7/13
to tumbl...@googlegroups.com
My current understanding is the correct way to paginate through 'tagged api' data is using the 'before' parameter and setting it to the timestamp returned in the previous results.  On occasion I've noticed that the posts aren't returned perfectly sorted by timestamp, but it wasn't a big deal I just sorted them myself and moved on.

Today I executed http://api.tumblr.com/v2/tagged?tag=quotes&api_key=xxxxxxxxxx&limit=20&before=1370633883 and it returned a bunch of posts like you would expect with timestamps before that, but it also returned a post with a timestamp of 1259695320 (post pasted below) which clearly doesn't seemingly belong.

I did some sleuthing and from what I can tell it is being included because it wasn't posted around 1370633883 but was reblogged around then, so my new guess as to what is happening is posts are returned from the tagged api sorted by what time they were last posted/reblogged.  I don't know if that's a design decision or not, but if that's the desired behavior I don't understand how to paginate because the reblogged timestamp isn't returned here.

Imagine if the problem post was the last post and I used the last post's timestamp to set the next 'before' parameter.  I would end up with:
http://api.tumblr.com/v2/tagged?tag=quotes&api_key=xxxxxxxxxx&limit=20&before=1259695320

and miss a few thousand pages.

Perhaps I'm missing something obvious.  Thanks!
Grant


{
            "highlighted": [],
            "image_permalink": "http://saysoftly.tumblr.com/image/52398736101",
            "source_title": "Flickr / cornhusk",
            "reblog_key": "5qz8pb6m",
            "format": "html",
            "timestamp": 1259695320,
            "note_count": 1,
            "tags": [
                "word art",
                "quotes",
                "picasso"
            ],
            "photos": [
                {
                    "caption": "",
                    "original_size": {
                        "width": 500,
                        "height": 378
                    },
                    "alt_sizes": [
                        {
                            "width": 500,
                            "height": 378
                        },
                        {
                            "width": 400,
                            "height": 302
                        },
                        {
                            "width": 250,
                            "height": 189
                        },
                        {
                            "width": 100,
                            "height": 76
                        },
                        {
                            "width": 75,
                            "height": 75
                        }
                    ]
                }
            ],
            "id": 52398736101,
            "post_url": "http://saysoftly.tumblr.com/post/52398736101",
            "caption": "",
            "state": "published",
            "short_url": "http://tmblr.co/ZYC44smpDKBb",
            "date": "2009-12-01 19:22:00 GMT",
            "source_url": "http://www.flickr.com/photos/cornhusk/4123246758/",
            "type": "photo",
            "slug": "",
            "blog_name": "saysoftly"
        }
Reply all
Reply to author
Forward
0 new messages