我在哪里可以找到图片的Instagram媒体ID [英] Where do I find the Instagram media ID of a image

查看:276
本文介绍了我在哪里可以找到图片的Instagram媒体ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找已上传的Instagram图片的MediaID.看起来应该是

I'm am looking for the MediaID of an Instagram image which has been uploaded. It should look like

1234567894561231236_33215652

1234567894561231236_33215652

我发现最后一组整数是usersID

I have found out the last set of integers are the usersID

例如:这是图像的直接链接,但是我看不到正确格式的mediaID吗?

For example: this is the link for the image directly, however I see no mediaID in the correct format?

http://distilleryimage11.ak.instagram.com/d33aafc8b55d11e2a66b22000a9f09de_7.jpg

这是链接

http://instagram.com/p/Y7GF-5vftL/

我不希望使用该API,因为我只需要所选图像中的MediaID.

I don't wish to use the API as all I need the MediaID from a selected image.

推荐答案

这是一种更好的方法:

http://api.instagram.com/oembed?url=http://instagram.com/p/Y7GF-5vftL/

渲染为json对象,您可以轻松地从中提取媒体ID ---

Render as json object and you can easily extract media id from it ---

例如,在PHP中

$api = file_get_contents("http://api.instagram.com/oembed?url=http://instagram.com/p/Y7‌​GF-5vftL/");      
$apiObj = json_decode($api,true);      
$media_id = $apiObj['media_id'];

例如,在JS中

$.ajax({     
    type: 'GET',     
    url: 'http://api.instagram.com/oembed?callback=&url=http://instagram.com/p/Y7GF-5vftL‌​/',     
    cache: false,     
    dataType: 'jsonp',     
    success: function(data) {           
        try{              
            var media_id = data[0].media_id;          
        }catch(err){}   
    } 
});

这篇关于我在哪里可以找到图片的Instagram媒体ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆