mpratt / Embera

A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has advanced features like offline support, responsive embeds and caching support.
MIT License
339 stars 59 forks source link

Instagram changed their response object #21

Closed Dreamdealer closed 9 years ago

Dreamdealer commented 9 years ago

$response['url'] threw a fatal error. The key apparantly changed from "url" to "provider_url".

mpratt commented 9 years ago

Hi Dreamdealer,

Thanks for the PR! I will merge it as soon as I get home!

mpratt commented 9 years ago

Hi Dreamdealer,

You were right, the Instagram Provider did changed their response object. However the provider_url key always returns, the provider url, which in this case is always https://instagram.com. The Instagram::modifyResponse() method exists because instagram didnt returned an html key, so Embera was generating that code "automatically" for images.

It seems like Instagram is now returning the html key on most (if not all) responses, so the modifyResponse() is not really that useful at the moment. Anyway, Im going to keep the method, just in case there are still resources without html code and I'm adding a check for response['url'] so that It doesnt give a Fatal Error.

Thank you very much for taking the time to report this bug! (Im not merging your PR, since Im doing other changes to the code).