2016-07-18 35 views

回答

0

按照here,你就必須:

  1. 呼叫/users/self/media/recent和結果搶ID。從上面的鏈接樣本輸出:

    { 
        "data":[{ 
         "comments": { 
          "count": 0 
         }, 
        "caption": {.....}, 
        "likes": {.....}, 
        ..... 
        "id": "##########", 
        ..... 
    } 
    

    你需要搶ID,[data][id]

  2. 從這裏,你將需要調用/media/media-id/comments,其中media-id是我們從第1步通過Instagram的給出的樣本輸出搶到id是如下:

    { 
        "data": [ 
        { 
         "created_time": "1280780324", 
         "text": "Really amazing photo!", 
         "from": { 
          "username": "snoopdogg", 
          "profile_picture": "http://images.instagram.com/profiles/profile_16_75sq_1305612434.jpg", 
          "id": "1574083", 
          "full_name": "Snoop Dogg" 
         }, 
         "id": "420" 
        }, 
        ... 
        ] 
    } 
    
  3. 從這裏,你會必須通過[data][from]進行解析,以將其限制爲僅限自己或通過[data][text]來搜索提及。


  1. https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN
  2. https://api.instagram.com/v1/media/{media-id}/comments?access_token=ACCESS-TOKEN
相關問題