Select items by category in SyndicationFeed

117 views Asked by At

I am using the .NET SyndicationFeed to create my own RSS website feed. No problem creating it and displaying all of them but I have not quite figure out how to select all the news items in the feed that have a specific category.

For example all items that have been categorized in SyndicationItem.Category with "Art". I want to display them in an MVC view where I have a dropdown list where the categories can be selected.

1

There are 1 answers

0
antorqs On

I've faced a similar problem with a website and it's rss feed. The solution I found was going through the feed of the category page. Let's say the url is www.mywebsite.com/feed , and when I want the posts categorized within 'Art', I go to www.mywebsite.com/category/art/feed and there I got all the posts under that category.

The issue would be determining the url form where you can find every category posts because it's different from website to website (www.url.com/category/catName or www.url.com/section/catName for example)

And the other problem is, I did not find a feed for the categories list to populate the dropdown list you mention, so I had to do it manually.

I know it's not a definite answer but I hope it helps.