I've spent about 16 hours researching and attempting different code changes, but cannot figure this one out. I have an iOS app that consumes a website using ASIHTTPrequest:
-(void)refresh{
NSURL *url = [NSURL URLWithString@"http://undignified.podbean.com/"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSString *response = [request responseString];
NSLog(@"%@",response];
}
The above code returns the website source and spits it out to the console via NSLog. The goal I'm trying to achieve from this is search through the 'responseString' for URLs ending in *.mp3, load those into an array and finally load the mp3 URLs into a UITableView.
To summarize:
- Consuming website data with ASIHTTPRequest
- Trying to search through the responseString for all links that have *.mp3 extensions and load them into an array.
- Add parsed links to UITableView.
I think at this junction I have attempted too many things to make any sound judgements at this point. Any suggestions or nudges in the right direction would be greatly appreciative.
Below is an example of the response (HTML). Please note this is only a snippet as the entire HTML source is rather large, but this includes a section to the mp3 files:
a href="http://undignified.podbean.com/mf/web/ih2x8r/UndignifiedShow01.mp3" target="new"><img src="http://www.podbean.com/wp-content/plugins/podpress/images/audio_mp3_button.png" border="0" align="top" class="podPress_imgicon" alt="icon for podbean" /></a> Standard Podcasts [00:40:24m]: <a href="javascript:void(null);" onclick="podPressShowHidePlayerDiv('podPressPlayerSpace_2649518', 'mp3Player_2649518_0', '300:30', 'http://undignified.podbean.com/mf/play/ih2x8r/UndignifiedShow01.mp3'); return false;"><span id="podPressPlayerSpace_2649518_label_mp3Player_2649518_0">Play Now</span></a> | <a href="javascript:void(null);" onclick="window.open ('http://undignified.podbean.com/wp-content/plugins/podpress/podpress_backend.php?podPressPlayerAutoPlay=yes&standalone=yes&action=showplayer&pbid=0&b=458211&id=2649518&filename=http://undignified.podbean.com/mf/play/ih2x8r/UndignifiedShow01.mp3', 'podPressPlayer', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=360'); return false;">Play in Popup</a> | <a href="http://www.podbean.com/podcast-download?b=458211&f=http://undignified.podbean.com/mf/web/ih2x8r/UndignifiedShow01.mp3" target="26108">Download</a> | <a href="http://www.podbean.com/podcast-players?b=458211&p=2649518&f=http://undignified.podbean.com/mf/play/ih2x8r/UndignifiedShow01.mp3" target="38148">Embeddable Player</a> | <a>Hits (214)</a><br/