2

I am working on news based application in which I want to fetch the dynamic feed with just typing website's name.

For example: If i want to fetch feed from CNN.com or BBCNEWS.com or etc , then i have to just write website name in textbox like "BBC.com" in place of it's rss urlname

http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml.

I know how to fetch feed from static link but i want to do it dynamically

I have searched a lot regarding this but havn't find any answer. I have seen this in feedly application. In which they have done like this.

so, if anybody know then help me regarding this issue.

Badal Shah
  • 7,541
  • 2
  • 30
  • 65

2 Answers2

0

In the HTML of the site, you'll find a snippet like this

<link rel='alternate' type='application/rss+xml' title='RSS' href='http://feeds.feedburner.com/martini'>

That's where the RSS URL comes from.

chedabob
  • 5,835
  • 2
  • 24
  • 44
0

RSS comes with a mechanism call Auto-Discovery which links RSS feeds to an HTML page.

It relies on the use of a <link> element in the <head> section of any HTML page.

The <link> tag includes 4 important elements:

  • rel should include alternate which tells the application that the linked document contains an alternate view of the current document/page. You can also use the feed value, even though, in our experience, this is much less frequent. Using both is probably a safe bet
  • type indicates the MIME type of this alternate representation. RSS uses application/rss+xml while Atom uses application/atom+xml
  • title is a human description of the document. It’s good to re-use the page’s title. Do not add RSS as it’s meaningless for people :)
  • href is the most important attribute: it’s the URL (relative or absolute) of the feed.

Here’s, for example, the discovery for this page's very RSS feed:

<link rel="alternate" type="application/atom+xml" title="Feed for question &#39;iOS RSSFeed, How to fech feed automatic from website&#39;" href="/feeds/question/32946522">

It's a great example!

Julien Genestoux
  • 31,046
  • 20
  • 66
  • 93
  • thanks a lot for help. I have used your way but to find link i have used nsscanner class and i am stuck at regex (character-set)format. if you have any idea can you please help me in this . http://stackoverflow.com/questions/33007842/ios-how-to-find-full-rss-feed-link-with-nsscanner-class – Badal Shah Oct 08 '15 at 07:28