mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-09-20 01:54:20 +02:00
42 lines
1007 B
C#
42 lines
1007 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using CodeHollow.FeedReader;
|
|
using SharpRss.Models;
|
|
|
|
namespace SharpRss
|
|
{
|
|
public class RssService
|
|
{
|
|
public RssService()
|
|
{
|
|
//TODO: Check if db exists else create.
|
|
}
|
|
|
|
public async Task<HashSet<CategoryItem>> GetCategories()
|
|
{
|
|
return new HashSet<CategoryItem>();
|
|
}
|
|
|
|
public async void GetFeeds()
|
|
{
|
|
//TODO: Load from db or something.
|
|
|
|
var urls = await FeedReader.GetFeedUrlsFromUrlAsync(_feeds[0]);
|
|
string url;
|
|
if (urls.Count() < 1)
|
|
url = _feeds[0];
|
|
else
|
|
url = urls.First().Url;
|
|
|
|
Feed f = await FeedReader.ReadAsync(url);
|
|
}
|
|
|
|
private readonly string[] _feeds = { "https://www.reddit.com/r/freshrss/.rss", "http://fedoramagazine.org/" };
|
|
|
|
private void CheckDbExist()
|
|
{
|
|
|
|
}
|
|
}
|
|
} |