Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-08-2012, 05:09 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2012
Posts: 10
ganesh.sics is on a distinguished road
Default Getting full details from a link in the RSS data

I have an RSS link in which there are rss links to pages such as AFL,Football, Basketball,Cricket etc. When I click that the RSS links are obtained. For example in case of AFL the rss link directs to the page

Sportal.com.au - AFL News Headlines

Here there are tags called "description" but there is only a part of description inside that tag. The full description is present inside the link present inside the tag "link". Here for example the link is

http://www.sportal.com.au/afl-news-d...feature-160240

How can I get these full description from the above link? I'm in such a urgency. Any help is appreciated.

//The Main Link is //http://www.sportal.com.au/rss

Thanks
ganesh.sics is offline   Reply With Quote
Old 02-10-2012, 12:03 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 94
JamesCahall is on a distinguished road
Default

Quote:
Originally Posted by ganesh.sics View Post
I have an RSS link in which there are rss links to pages such as AFL,Football, Basketball,Cricket etc. When I click that the RSS links are obtained. For example in case of AFL the rss link directs to the page

Sportal.com.au - AFL News Headlines

Here there are tags called "description" but there is only a part of description inside that tag. The full description is present inside the link present inside the tag "link". Here for example the link is

Pies duo set to feature - AFL - Sportal Australia

How can I get these full description from the above link? I'm in such a urgency. Any help is appreciated.

//The Main Link is //http://www.sportal.com.au/rss

Thanks
You can get NSData from the url via [NSData dataWithContentsOfURL:url];

You would then have to know how to extract the information from the nsdata that you are interested in. If it is always the same website with the same format, look at the source of the website. If there is a an object such as a div with a specific class name, you could pull all the html in that div.

Here is a synchronous example (depending on the html size, you may want to do this with a asynchronous data request):

NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://beachforbaby.com/30-before-30-cali-style/"]];

NSString* newStr = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];

NSString *substring;

NSScanner *htmlScanner = [NSScanner scannerWithString:newStr];

[htmlScanner scanUpToString:@"<div class=\"blog_info\">" intoString:NULL];
[htmlScanner scanUpToString:@"<p>" intoString:NULL];

[htmlScanner scanUpToString:@"</div><!--/blog_info-->" intoString:&substring];

NSLog(@"Substring: %@", substring);

And then clean up the html tags, unwanted data, etc.

James
JamesCahall is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 390
12 members and 378 guests
7twenty7, chiataytuday, fiftysixty, gmarro, iOS.Lover, KennyChong, kilobytedump, Leslie80, Matrix23, ryantcb, stanny, xerohuang
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0