using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CodeHollow.FeedReader;
using SharpRss.Models;
namespace SharpRss
{
///
/// Managing RSS feeds and categories.
///
public class RssService
{
public RssService()
{
/// Storage options:
/// - Database
/// - File
/// - Memory
}
public async Task> GetCategories()
{
return new HashSet();
}
public async Task> GetAllFeeds()
{
return new HashSet();
}
/// Old
public async Task GetFeed(string feedUrl)
{
var urls = await FeedReader.GetFeedUrlsFromUrlAsync(feedUrl);
string url;
if (urls.Count() < 1)
url = _feeds[0];
else
url = urls.First().Url;
return await FeedReader.ReadAsync(url);
}
public async Task> GetFeedsFromCatAsync(CategoryModel category)
{
return new HashSet();
}
private readonly string[] _feeds = { "https://www.reddit.com/r/freshrss/.rss", "http://fedoramagazine.org/" };
}
}