I am working on getting the URL from the following inside an XML:
I just need the URL of the mp3. I am using GDataXML and I know I need to use GDataXMLNode to get the attributeForName enclosure, but not sure how to do it. Right now I have:
The NSLog comes back as null for each entry...Any thoughts?
Code:
<item>
<title>Accomidations on Your Trip</title>
<link>http://treymorgan.podbean.com/2012/06/05/accomidations-on-your-trip/</link>
<enclosure url="http://treymorgan.podbean.com/mf/feed/bf8mvq/Accommoditions.mp3" length="29865594" type="audio/mpeg"/>
</item>
I just need the URL of the mp3. I am using GDataXML and I know I need to use GDataXMLNode to get the attributeForName enclosure, but not sure how to do it. Right now I have:
Code:
- (void)parseRss:(GDataXMLElement *)rootElement entries:(NSMutableArray *)entries {
NSArray *channels = [rootElement elementsForName:@"channel"];
for (GDataXMLElement *channel in channels) {
NSString *blogTitle = [channel valueForChild:@"title"];
NSArray *items = [channel elementsForName:@"item"];
for (GDataXMLElement *item in items) {
NSString *articleTitle = [item valueForChild:@"title"];
NSString *articleUrl = [item valueForChild:@"link"];
GDataXMLNode *nodes = [item attributeForName:@"enclosure"];
NSLog(@"%@", nodes);
}
}
}