In my application, I would like to allow user introduce a url of instagram, and then automatically retrieve the embed code of it.
I found this reference: https://www.instagram.com/developer/embedding/#oembed
When I try the given example (https://api.instagram.com/oembed?url=http://instagr.am/p/fA9uwTtkSN) in my Chrome browser, I get the json with the code I am looking for.
However, if I try this from the rails console:
Net::HTTP.get_response(URI("https://api.instagram.com/oembed?url=http://instagr.am/p/fA9uwTtkSN"))
I get this:
#<Net::HTTPMovedPermanently 301 MOVED PERMANENTLY readbody=true>
I saw that instagram have a new API, but I don't want to make user authenticate from instagram.
Is there a way to do it?