You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line of WordPress pages are not parsed correcty, I think.
It states: <link rel="alternate" type="application/json+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=json&url=https%3A%2F%2Fsweetandweak.wordpress.com%2F2011%2F09%2F23%2Fnothing-starts-the-morning-like-a-good-dose-of-panic%2F&for=wpcom-auto-discovery"><link rel="alternate" type="application/xml+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=xml&url=https%3A%2F%2Fsweetandweak.wordpress.com%2F2011%2F09%2F23%2Fnothing-starts-the-morning-like-a-good-dose-of-panic%2F&for=wpcom-auto-discovery">
After writing some tests for OEmbed::ProviderDiscovery I've discovered that this is (to some extent) WordPress's fault for not following the oEmbed specification. According to WordPress's API documentation their oEmbed endpoint requires a for parameter with each request. In its current state, OEmbed::ProviderDiscovery isn't intelligent enough to pass along extra parameters like for, and so WordPress returns an error.
All that to say, this is still an open issue, but at least it's an understood issue now and has some decent test coverage available once a fix is written.
The line of WordPress pages are not parsed correcty, I think.
It states:
<link rel="alternate" type="application/json+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=json&url=https%3A%2F%2Fsweetandweak.wordpress.com%2F2011%2F09%2F23%2Fnothing-starts-the-morning-like-a-good-dose-of-panic%2F&for=wpcom-auto-discovery"><link rel="alternate" type="application/xml+oembed" href="http://public-api.wordpress.com/oembed/1.0/?format=xml&url=https%3A%2F%2Fsweetandweak.wordpress.com%2F2011%2F09%2F23%2Fnothing-starts-the-morning-like-a-good-dose-of-panic%2F&for=wpcom-auto-discovery">
probably you just have to say
provider_endpoint ||= /<link.*href=['"]*([^\s'"]+)['"]*.*application\/json\+oembed.*>/.match(res.body)[0]
instead of
provider_endpoint ||= /<link.*href=['"]*([^\s'"]+)['"]*.*application\/json\+oembed.*>/.match(res.body)
in these lines: https://github.com/judofyr/ruby-oembed/blob/master/lib/oembed/provider_discovery.rb#L41
The text was updated successfully, but these errors were encountered: