"MDL-16911, update youtube repository plugin"

This commit is contained in:
dongsheng
2009-08-13 03:35:23 +00:00
parent e4c5abdc56
commit 3d1df2fec3
+5 -5
View File
@@ -9,10 +9,10 @@
class repository_youtube extends repository {
public function __construct($repositoryid, $context = SITEID, $options = array()) {
$options['keyword'] = optional_param('youtube_keyword', '', PARAM_RAW);
$options['start'] =1;
$options['max'] = 27;
$options['sort'] = 'relevance';
$this->keyword = optional_param('youtube_keyword', '', PARAM_RAW);
$this->start =1;
$this->max = 27;
$this->sort = 'published';
parent::__construct($repositoryid, $context, $options);
}
@@ -29,7 +29,7 @@ class repository_youtube extends repository {
private function _get_collection($keyword, $start, $max, $sort) {
$list = array();
$this->feed_url = 'http://gdata.youtube.com/feeds/api/videos?vq=' . urlencode($keyword) . '&format=5&start-index=' . $start . '&max-results=' .$max . '&orderby=' . $sort;
$this->feed_url = 'http://gdata.youtube.com/feeds/api/videos?q=' . urlencode($keyword) . '&format=5&start-index=' . $start . '&max-results=' .$max . '&orderby=' . $sort;
$c = new curl(array('cache'=>true, 'module_cache'=>'repository'));
$content = $c->get($this->feed_url);
$xml = simplexml_load_string($content);