Skip to content

Commit

Permalink
Merge pull request #1 from dkordik/master
Browse files Browse the repository at this point in the history
Add duration, author, thumbnails, statistics (favoriteCount/viewCount), published date, and updated date to result output
  • Loading branch information
MaxGfeller committed Nov 13, 2013
2 parents d3587ec + 702942e commit 49837e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ youtubeSearch.search = function(q, opts, cb) {
title: entry.title[0]._,
url: entry.link[0].$.href,
category: entry.category[1].$.term,
description: entry.content[0]._
description: entry.content[0]._,
duration: entry["media:group"][0]["yt:duration"][0].$.seconds,
author: entry.author[0].name[0],
thumbnails: entry["media:group"][0]["media:thumbnail"].map(function (size) {
return size.$;
}),
statistics: entry["yt:statistics"] ? entry["yt:statistics"][0].$ : {},
published: entry.published[0],
updated: entry.updated[0]
};
}));
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-search",
"version": "0.0.2",
"version": "0.0.3",
"description": "Search for youtube videos",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 49837e6

Please sign in to comment.