Displaying on-image instagram tags

拜拜、爱过 提交于 2019-12-11 18:03:15

问题


Can I display the on-image (tooltip type) tags created by users through the IG api on images? The basic tags/{tag-name} isn't the answer for specific on image tags.


回答1:


Yes you can. The API returns users_in_photos in json response for any media that has user tags, it has user details and position of tagged location in photo:

 "users_in_photo": [{
    "user": {
        "username": "kevin",
        "full_name": "Kevin S",
        "id": "3",
        "profile_picture": "..."
    },
    "position": {
        "x": 0.315,
        "y": 0.9111
    }
}],

multiply the position.x and position.y by the width of image you are displaying, that is the pixel offset of tagged location on the photo. create a tooltip css and display the username there, here is example: http://gramfeed.com/instagram/900635430205440533_55431



来源:https://stackoverflow.com/questions/28698519/displaying-on-image-instagram-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!