I am trying to make a simple RSS reader using SyndicationFeed
class.
There are some standard tags, like <title>
, <link>
, <description>
... there is no problem with them.
But there are some other tags. for example, in this feed, which created by WordPress, there is <content:encoded>
tag. I think there may be other tags for the content part of other websites. right?
I want to know, how to find the main content of every post, is there any standards? which tags should I look for?
(for example, a site may use <content:encoded>
but some other just use <description>
or someone use another standard... I don't know what to do for retrieving the main content of a post)
P.S : I'm using this code for testing my simple RSS reader:
var reader = XmlReader.Create("http://feed.2barnamenevis.com/2barnamenevis");
var feed = SyndicationFeed.Load(reader);
string s = "";
foreach (SyndicationItem i in feed.Items)
{
s += i.Title.Text + "<br />" + i.Summary.Text + "<br />" + i.PublishDate.ToString() + "<br />";
foreach (SyndicationElementExtension extension in i.ElementExtensions)
{
XElement ele = extension.GetObject<XElement>();
s += ele.Name + " :: " + ele.Value + "<br />";
}
s += "<hr />";
}
return s;