Parsing json "meta" from Dribble api

I have json from Dribble api:

/**/foo({
  "meta": {
    "X-RateLimit-Limit": 60,
    "X-RateLimit-Remaining": 59,
    "X-RateLimit-Reset": 1429948020,
    "Link": [
      [
        "https://api.dribbble.com/v1/users/234460/shots?access_token=accesstoken\u0026callback=foo\u0026page=4\u0026per_page=2",
        {
          "rel": "next"
        }
      ],
      [
        "https://api.dribbble.com/v1/users/234460/shots?access_token=accesstoken\u0026callback=foo\u0026page=2\u0026per_page=2",
        {
          "rel": "prev"
        }
      ]
    ],
    "status": 200
  },
  "data": [
    {

      

I can get most of what I need from the "data" in my "playerShots" object, you can only see the beginning from the end there, for example:

    $.each(playerShots.data, function (i, shot) {
        html.push('<div class="%id%imageFrame">');
        html.push('<img src="' + shot.images.teaser + '" alt="' + shot.title + '" data-url="' + shot.html_url + '" />');

      

But you need to "Link" from the "meta" object, and if so:

JSON.stringify(playerShots.meta)

      

It shows me this with no signs of a "link".

{"X-RateLimit-Limit":60,"X-RateLimit-Remaining":58,"X-RateLimit-Reset":1429948980,"status":200}

      

So I cannot do this:

JSON.stringify(playerShots.meta.Link) 

      

Please help .. how do I get these links ..? Preferably referring to "next" and "previous" so I know what I have.

+3


source to share


1 answer


Using

var link = result.meta.Link;
var nextLink = link[0][0];
var prevLink = link[0][1];

      



result.meta.Link

returns the result of an array

0


source







All Articles