?

Log in

No account? Create an account

Previous Entry | Next Entry

I haven't really seen this spelled out in a really clear manner on the web, so let me help out. YouTube's got useful programmatic feeds. You can specify a feed for a user's videos like:

http://gdata.youtube.com/feeds/base/users/communitychannel/uploads

You can also specify the order in which you want the videos.  Note the "orderedby" parameter in the urls that follow:

http://gdata.youtube.com/feeds/base/users/communitychannel/uploads?orderby=updated
http://gdata.youtube.com/feeds/base/users/communitychannel/uploads?orderby=published

So far, so great. Now, suppose you want to make a lifestream, and you want to include the videos that you've favorited. They've got a feed for that, too:

http://gdata.youtube.com/feeds/api/users/davidblume/favorites

But it's not right.  If you look at the data you get back, you see that it's not what you wanted. Those videos are going to be associated with the timestamp with which they were updated or published, not the time that you favorited them. And that's the time that matters to your lifestream! Given the way the programmatic feeds are organized, you'd think that there's a way to specify that, and that feed would be as follows, right? --

http://gdata.youtube.com/feeds/api/users/davidblume/favorites?orderby=favorited

Nope. After living with a workaround in my lifestream for months, only today do I learn that YouTube did create the feed I needed, but calls it this: v=2. Yeah, like that jibes with their feed explanation.

Lifestream writers, the favorites feed (ordered by time favorited) that you want is constructed like this:

http://gdata.youtube.com/feeds/api/users/username/favorites?v=2

(Replace "username" with your username, of course.)  Now I can go delete my workaround.