Accessing Recorded Date of a Youtube Video

77 views
Skip to first unread message

Somnath Banerjee

unread,
Sep 17, 2010, 1:52:16 AM9/17/10
to gdata-objec...@googlegroups.com
Hello everyone,
I am trying to access the recorded date of a Youtube video.

I am using the following code segment:

GDataEntryYouTubeVideo *video = (GDataEntryYouTubeVideo *)entry;

NSString *videoURL = [[[video links] objectAtIndex: 0] href];

GDataYouTubeStatistics *stats = [video statistics];

GDataYouTubeRating *rating  = [video rating];

GDataDateTime *recordedDate = [video recordedDate];



Please note that the recordedDate either returns null or an incorrect date.

I have also tried publishedDate etc.  but no luck.


However, ratings (likes, dislikes), and stats(viewCount)  all return fine.


I must be doing something wrong.

Any help would be much appreciated.

Best regards, Somnath

Greg Robbins

unread,
Sep 17, 2010, 12:18:41 PM9/17/10
to gdata-objec...@googlegroups.com
Have you compared the yt:recorded element in the XML from http logs with the value of the GDataDateTime response from the recordedDate method?

The presence or absence of the yt:recorded element is up to the YouTube API server; it is only an Objective-C library issue if it is not being translated properly to a GDataDateTime object.

http logging is described at 


Greg Robbins

unread,
Sep 17, 2010, 8:56:07 PM9/17/10
to gdata-objec...@googlegroups.com
I have just checked in some changes to the top-of-trunk library sources that should improve how date-only (no time) GDataDateTime objects are converted to NSDates. They now are set to noon GMT, so the date should be correct for any time zone.

Since yt:recorded is a date-only element, this may improve the date you see in the video entry, for video entries where that element is returned by the server.

Somnath Banerjee

unread,
Sep 18, 2010, 1:26:06 AM9/18/10
to gdata-objec...@googlegroups.com
Greg,
Tried a few times.  No luck!
May be I am doing something wrong.
If you want I can send across by test project.

best regards, Somnath

On Fri, Sep 17, 2010 at 5:56 PM, Greg Robbins <grob...@google.com> wrote:
I have just checked in some changes to the top-of-trunk library sources that should improve how date-only (no time) GDataDateTime objects are converted to NSDates. They now are set to noon GMT, so the date should be correct for any time zone.

Since yt:recorded is a date-only element, this may improve the date you see in the video entry, for video entries where that element is returned by the server.


--
You received this message because you are subscribed to the Google Groups "Google Data APIs Objective-C Client Library Discussion" group.
To post to this group, send email to gdata-objec...@googlegroups.com.
To unsubscribe from this group, send email to gdata-objectivec-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gdata-objectivec-client?hl=en.

Greg Robbins

unread,
Sep 18, 2010, 2:16:24 AM9/18/10
to gdata-objec...@googlegroups.com
This sounds like a Twitter-specific issue; the OAuth client software is not really involved while the sign-in page is being displayed.

Can you sign in with any other Twitter client applications that use OAuth?

Thomas Van Lenten

unread,
Sep 18, 2010, 7:04:49 PM9/18/10
to gdata-objec...@googlegroups.com
On Sat, Sep 18, 2010 at 1:26 AM, Somnath Banerjee <sbaner...@gmail.com> wrote:
Greg,
Tried a few times.  No luck!
May be I am doing something wrong.
If you want I can send across by test project.

What's the problem, were you not able to turn on logging?  A log should help us see what the problem is.

TVL

Thomas Van Lenten

unread,
Sep 18, 2010, 7:05:21 PM9/18/10
to gdata-objec...@googlegroups.com
On Sat, Sep 18, 2010 at 2:16 AM, Greg Robbins <grob...@google.com> wrote:
This sounds like a Twitter-specific issue; the OAuth client software is not really involved while the sign-in page is being displayed.

Can you sign in with any other Twitter client applications that use OAuth?

I think you crossed threads in your inbox.  ;)

TVL
Reply all
Reply to author
Forward
0 new messages