How can I get an direct Instagram link from a twitter entity?

拟墨画扇 提交于 2019-12-20 10:23:26

问题


I have a twitter feed and I can find the instagram url in a tweet.

{
    indices: [
        90,
        110
    ],
    url: "http://t.co/kF9EXifn",
    expanded_url: "http://instagr.am/p/QC8hWKL_4K/",
    display_url: "instagr.am/p/QC8hWKL_4K/"
}

What I need is to take the expanded url from that object "http://instagr.am/p/QC8hWKL_4K/" and get the link to just the image itself, not the image on the Instagram site. Anyone know how to do that? Can I even derive the that link from the url?


回答1:


You can get just the image by appending /media/ to the URL. Using your example: http://instagr.am/p/QC8hWKL_4K/media/.

You can even specify a size,

One of t (thumbnail), m (medium), l (large). Defaults to m.

So for a thumbnail: http://instagr.am/p/QC8hWKL_4K/media/?size=t

Documentation here.



来源:https://stackoverflow.com/questions/12682039/how-can-i-get-an-direct-instagram-link-from-a-twitter-entity

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