Note that there are some explanatory texts on larger screens.

plurals
  1. POPrinting a YouTube video feed in php
    text
    copied!<p>I'm in the beginning stages of writing a plugin to display YouTube videos in a WordPress implementation. Here is my code:</p> <pre><code>require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata_Youtube'); $yt = new Zend_Gdata_YouTube(); function getAndPrintVideoFeed($location::'http://gdata.youtube.com/feeds/api/users/thelanzolini/uploads/-/step') { $yt = new Zend_Gdata_YouTube(); // set the version to 2 to receive a version 2 feed of entries $yt-&gt;setMajorProtocolVersion(2); $videoFeed = $yt-&gt;getVideoFeed($location); printVideoFeed($videoFeed); } function printVideoFeed($videoFeed) { $count = 1; foreach ($videoFeed as $videoEntry) { echo "Entry # " . $count . "\n"; printVideoEntry($videoEntry); echo "\n"; $count++; } } </code></pre> <p>All I get is this error:</p> <p><img src="https://i.stack.imgur.com/rgBHI.png" alt="enter image description here"></p> <p>I am using MAMP. php is version 5.4.10.</p> <p><strong>Switching the <code>$location::</code> above for a <code>$location =</code> I get no errors within the actual plugin file itself but rather in loading various components of Zend.</strong></p> <h2>Errors:</h2> <blockquote> <p>Warning: include_once(Zend/Gdata/Youtube.php): failed to open stream: No such file or directory in /Users/mrcsmcln/Documents/MAMP/wordpress/wp-content/plugins/youtube-filter/Zend/Loader.php on line 134</p> <p>Warning: include_once(): Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php') in /Users/mrcsmcln/Documents/MAMP/wordpress/wp-content/plugins/youtube-filter/Zend/Loader.php on line 134</p> <p>Warning: require_once(Zend/Exception.php): failed to open stream: No such file or directory in /Users/mrcsmcln/Documents/MAMP/wordpress/wp-content/plugins/youtube-filter/Zend/Loader.php on line 86</p> <p>Fatal error: require_once(): Failed opening required 'Zend/Exception.php' (include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php') in /Users/mrcsmcln/Documents/MAMP/wordpress/wp-content/plugins/youtube-filter/Zend/Loader.php on line 86</p> </blockquote> <p>What is wrong with my code? Is there a better way I can go about all this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload