mickknutson
05-19-2009, 12:18 PM
I have the vBTube hack installed:
https://vborg.vbsupport.ru/showthread.php?t=173083
What I want to do is sort the results by most recent (published) as defined in the YouTube API docs (orderby=published):
http://code.google.com/apis/youtube/migration.html#Difference
I have located what I think is the section of code that creates the query:
...
function videos_listbytag($tag = NULL,$page = 1, $per_page = 20)
{
/* http://www.youtube.com/dev_api_ref?m=youtube.videos.list_by_tag */
$this->request("youtube.videos.list_by_tag", array("tag" => $tag, "page" => $page, "per_page" => $per_page));
$this->parse_response();
$result = $this->parsed_response['ut_response']['video_list'];
return $result;
}
I know this hack originally came from flickr:
http://svn.symfony-project.com/plugins/sfYouTubePlugin/lib/phpYoutube/phpYoutube.php
Now I tried to just add it on the request line like:
$orderby = "published";
$this->request("youtube.videos.list_by_tag", array("tag" => $tag, "page" => $page, "per_page" => $per_page, "orderby" => $orderby));
But when I do that, I get zero results when I run the query. Taking it off, returns the expected results, but by relevance, not published.
Can someone please help me with this?
https://vborg.vbsupport.ru/showthread.php?t=173083
What I want to do is sort the results by most recent (published) as defined in the YouTube API docs (orderby=published):
http://code.google.com/apis/youtube/migration.html#Difference
I have located what I think is the section of code that creates the query:
...
function videos_listbytag($tag = NULL,$page = 1, $per_page = 20)
{
/* http://www.youtube.com/dev_api_ref?m=youtube.videos.list_by_tag */
$this->request("youtube.videos.list_by_tag", array("tag" => $tag, "page" => $page, "per_page" => $per_page));
$this->parse_response();
$result = $this->parsed_response['ut_response']['video_list'];
return $result;
}
I know this hack originally came from flickr:
http://svn.symfony-project.com/plugins/sfYouTubePlugin/lib/phpYoutube/phpYoutube.php
Now I tried to just add it on the request line like:
$orderby = "published";
$this->request("youtube.videos.list_by_tag", array("tag" => $tag, "page" => $page, "per_page" => $per_page, "orderby" => $orderby));
But when I do that, I get zero results when I run the query. Taking it off, returns the expected results, but by relevance, not published.
Can someone please help me with this?