Note that there are some explanatory texts on larger screens.

plurals
  1. POQuick fix with XML?
    primarykey
    data
    text
    <p>I'm currently using the YouTube API V2 and I'm getting incorrect data while gathering the description of the video.</p> <p><a href="http://gdata.youtube.com/feeds/api/users/gudjondaniel/uploads?v=2&amp;max-results=1" rel="nofollow">This is the link where I'm getting the XML information from.</a></p> <p>This is the string I'm suppose to be getting</p> <blockquote> <p>Can we hit 5000 Likes for all the great goals? :) <a href="http://www.facebook.com/GudjonDanielYT" rel="nofollow">http://www.facebook.com/GudjonDanielYT</a> <a href="https://twitter.com/GudjonDaniel" rel="nofollow">https://twitter.com/GudjonDaniel</a></p> </blockquote> <p>but I get this one</p> <blockquote> <p>GudjonDanielhttp://gdata.youtube.com/feeds/api/users/GudjonDanielkM0YirXKa4Lb7MsgqHWiMwEntertainmentgudjondanielCan we hit 5000 Likes for all the great goals? :) <a href="http://www.facebook.com/GudjonDanielYT" rel="nofollow">http://www.facebook.com/GudjonDanielYT</a> <a href="https://twitter.com/GudjonDaniel" rel="nofollow">https://twitter.com/GudjonDaniel</a></p> </blockquote> <p>My code, it's in the <code>media:description</code></p> <pre><code>- (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { if ([elementname isEqualToString:@"title"] || [elementname isEqualToString:@"content"]) { currentNodeContent = [[NSMutableString alloc] init]; } else if ([elementname isEqualToString:@"entry"]) { currentFeed = [ChanelFeeds alloc]; } else if ([elementname isEqualToString:@"yt:duration"]) { currentFeed.duration = [attributeDict objectForKey:@"seconds"]; } else if ([elementname isEqualToString:@"yt:statistics"]) { currentFeed.views = [attributeDict objectForKey:@"viewCount"]; } else if ([elementname isEqualToString:@"gd:rating"]) { currentFeed.rating = [attributeDict objectForKey:@"average"]; } else if ([elementname isEqualToString:@"media:player"]) { currentFeed.streamURL = [NSURL URLWithString:[attributeDict objectForKey:@"url"]]; } else if ([elementname isEqualToString:@"media:thumbnail"] &amp;&amp; !currentFeed.thumbnailURL) { currentFeed.thumbnailURL = [NSURL URLWithString:[attributeDict objectForKey:@"url"]]; } } - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if ([elementname isEqualToString:@"title"]) { currentFeed.title = currentNodeContent; currentNodeContent = nil; } else if ([elementname isEqualToString:@"media:description"]) { currentFeed.description = currentNodeContent; currentNodeContent = nil; } else if ([elementname isEqualToString:@"entry"]) { [self.feeds addObject:currentFeed]; currentFeed = nil; currentNodeContent = nil; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload