bebanjo-projects/techtest-balinterdi — pull request #1 by balinterdi (2012-12-22 20:49:56+00:00)
Title: Youtube exporter

1. I first did not make title, description, category and keywords mandatory but I inserted the yt:incomplete tag if any of those were missing. I then saw that to update a video they need to be explicitly specified. The publisher, in theory, could fetch the videos to update first, extract their attributes and then the metadata can be generated with those.

Since I don't know how the publisher works, explicitly defining (and thus requiring) the attributes seemed a more straightforward and surefire way to go. (See the last commit where I switched to the "require attriubutes" solution.

1. There are definitely ways to make the exporter more robust that would need to be done if this was the actual code used in production. Some of those are:

* validating if the category and media rating is one of the predefined ones
* if the editorial version has several renditions, then for each rendition a separate video would have to be uploaded and thus metadata exported (unless, of course, I have the wrong idea of what renditions are :) )
* a few yt tags are yet to be generated in the output xml, such as yt:aspectratio, yt:audioTracks, yt:captionTracks, yt:duration. These could be fetched from the editorial version and its renditions.

1. I use rbenv not rvm hence the .rbenv-version file :) I also package the .gem files in the repository, in a vendor library (see [this blog post](http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/))

I think that's it and of course let me know if you questions/comments,

Have a nice Christmas,
Bálint