Search code examples
iphonegdata

You tube categories list using Gdata


I am using Gdata to upload video on you tube.

I need to list all categories to user and choose one for the particular video can we get categories list of you tube ?

Thanks for any help.


Solution

  • I can get list with this way. Don't know if there is other way too. We can get categories list in XML format with this link

    http://gdata.youtube.com/schemas/2007/categories.cat

    Get data with contents of this URL,

     NSURL *url=[[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://gdata.youtube.com/schemas/2007/categories.cat"]];
    NSData *data=[[NSData alloc] initWithContentsOfURL:url];
    NSString *str=[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
    

    You need to parse it and you can get it from @"label" value.

    Thanks.