I’m working with Embed.ly PHP, which you can find here. I’ve been trying to test out embedding with a few other sites, like articles from MLB or ESPN.
Working from examples/oembed.php, I replaced the first few links in the $urls array with a couple different links to see how they would embed. The links I tried:
http://sports.espn.go.com/ncf/news/story?id=6688739
http://mlb.mlb.com/news/article.jsp?ymd=20110621&content_id=20815268&vkey=news_mlb&c_id=mlb
The errors I get in their place:
Notice: Undefined index: provider_url
Notice: Undefined index: provider_name
I’m fairly sure embed.ly supports embedding from these sites, but I can’t figure out why I’m getting errors for these links.
EDIT Some additional info
When I use echo '<p>' . $oembed['type'] . '</p>'; right before each embed, the two above result in “error” being printed… some of the other ones print “video” or “photo”.
EDIT2 My code: http://pastebin.com/Z1P0K31E
I changed a one thing besides what I already noted: require_once path was changed to correct path of Embedly.php. That file is left exactly as it was found on github.
The issue concerns arrays that have indices
provider_urlandprovider_namethat are empty.So for example, there is
$some_array['provider_url']and$some_array['provider_name']that have empty values. I would find out where these variables are, and then I would track backwards or if you have some access to an error stack / trace stack, that would also be helpful.stdClass Object ( [error_code] => 401 [error_message] => This service requires an Embedly Pro account [type] => error )
You'll need a pro account whatever that is. That's the error message I got back from using their API. Case closed.