SharpRSS/SharpRss/RssService.cs

42 lines
1007 B
C#
Raw Normal View History

2023-05-07 02:42:37 +02:00
using System.Collections.Generic;
2023-04-27 17:23:01 +02:00
using System.Linq;
2023-05-07 02:42:37 +02:00
using System.Threading.Tasks;
2023-04-27 17:23:01 +02:00
using CodeHollow.FeedReader;
2023-05-07 02:42:37 +02:00
using SharpRss.Models;
2023-04-27 17:23:01 +02:00
namespace SharpRss
{
public class RssService
{
2023-04-28 21:58:36 +02:00
public RssService()
{
//TODO: Check if db exists else create.
}
2023-05-07 02:42:37 +02:00
public async Task<HashSet<CategoryItem>> GetCategories()
{
return new HashSet<CategoryItem>();
}
2023-04-27 17:23:01 +02:00
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/" };
2023-04-28 21:58:36 +02:00
private void CheckDbExist()
{
}
2023-04-27 17:23:01 +02:00
}
}