diff --git a/examples/oembed.php b/examples/oembed.php index 2f09ac9..d63aea3 100644 --- a/examples/oembed.php +++ b/examples/oembed.php @@ -62,25 +62,25 @@
'Mozilla/5.0 (compatible; embedly/example-app; support@embed.ly)' + 'user_agent' => 'Mozilla/5.0 (compatible; embedly/example-app; support@embed.ly)', + 'key' => getenv('EMBEDLY_KEY') )); $urls = array( - "http://www.slideshare.net/doina/happy-easter-from-holland-slideshare", "http://www.scribd.com/doc/13994900/Easter", - "http://screenr.com/t9d", - "http://www.5min.com/Video/How-to-Decorate-Easter-Eggs-with-Decoupage-142076462", + "http://www.youtube.com/watch?v=iF3gzfel-a0", "http://www.howcast.com/videos/328008-How-To-Marble-Easter-Eggs", "http://img402.yfrog.com/i/mfe.jpg/", - "http://tweetphoto.com/14784359", "http://www.flickr.com/photos/10349896@N08/4490293418/", "http://imgur.com/6pLoN", "http://twitgoo.com/1as", "http://www.qwantz.com/index.php?comic=1686", "http://www.23hq.com/mhg/photo/5498347", "http://www.youtube.com/watch?v=gghKdx558Qg", - "http://www.justin.tv/easter7presents", "http://revision3.com/hak5/DualCore", "http://www.dailymotion.com/video/xcstzd_greek-wallets-tighten-during-easter_news", "http://www.collegehumor.com/video:1682246", @@ -90,18 +90,19 @@ "http://www.metacafe.com/watch/105023/the_easter_bunny/", "http://blip.tv/file/449469", "http://video.google.com/videoplay?docid=-5427138374898988918&q=easter+bunny&pl=true", - "http://video.yahoo.com/watch/7268801/18963438", "http://www.viddler.com/explore/BigAppleChannel/videos/113/", "http://www.liveleak.com/view?i=e0b_1239827917", "http://www.hulu.com/watch/67313/howcast-how-to-make-braided-easter-bread", - "http://www.fancast.com/tv/It-s-the-Easter-Beagle,-Charlie-Brown/74789/1078053475/Peanuts:-Specials:-It-s-the-Easter-Beagle,-Charlie-Brown/videos", "http://www.funnyordie.com/videos/f6883f54ae/the-unsettling-ritualistic-origin-of-the-easter-bunny", "http://vimeo.com/10446922", "http://www.ted.com/talks/jared_diamond_on_why_societies_collapse.html", "http://www.thedailyshow.com/watch/thu-december-14-2000/intro---easter", ); -$oembeds = $api->oembed(array('urls' => $urls)); //, 'maxwidth' => 200)); +$oembeds = array(); +for ($i = 0; $i*20 < count($urls); $i++) { + $oembeds = array_merge($oembeds, $api->oembed(array('urls' => array_slice($urls, $i*20, 20)))); +} foreach ($oembeds as $k => $oembed) { $oembed = (array) $oembed; @@ -143,13 +144,20 @@ default: } - print ''; - print 'Error
'; + print ''; + break; + default: + print '