5
votes

I'm accessing the feed of a user's favorite videos through the YouTube API. How can I get the date/time in which he marked each video as favorite?

Update:

Someone pointed out that the YouTube API documentation says that the "Published" date on a user's favorite feed will have the time in which the user marked the video as favorite. But that seems to be false.

For example, check out this video entry:

http://gdata.youtube.com/feeds/api/videos/g2981r_MtHQ

It has a "published" date of 2008-03-19T21:09:09.000Z.

Now let's see the same video in the favorite feed of some user:

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

It has a "published" date of 2008-03-19T21:09:09.000Z. Identical.

Here is a different way to get the favorites feed:

http://gdata.youtube.com/feeds/base/users/KeepWatchingTheSkies/favorites

And still we have a "published" date of 2008-03-19T21:09:09.000Z.

Assuming the user was not quick enough to favorite the video on the same millisecond it was published, what's written in the YouTube documentation is probably wrong, and this is not the time in which the user marked the video as favorite.


So my question is: How can I get the time at which a user marked a video as favorite?

2

2 Answers

1
votes

I figured it out: The URLs must specify ?v=2 so version 2 of the API will be used.

Here's the fixed URL:

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

Now it shows a correct "published" time of 2010-09-03T08:59:53.000Z.

0
votes

It's easy.

The <published> tag in a favorite videos feed entry identifies the time that the video was marked as a favorite and not the time that the video was published.

from http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Favorite_Videos