I don't know why my RSS doesn't seem to work. By the way, I'm a rookie at building websites. Now I think my RSS format is right, because I got the content of my website on feedly.
But the problem is that feedly can only read last month's content.
I've updated my RSS and wrote several blogs in June, but feedly still hasn't got my blog content.
I don't know if it's related to my completely English website revision. I summarized some possible reasons:
- Format error
- Website revision
- Cloudflare doesn't update my RSS feed
This is the code that generates RSS feed for my website:
[HttpPost]
public string RssFeed()
{
var Blogs = _context.Blogs;
var Genre = _context.Genres;
var feed = new Feed()
{
Title = "EKsumic's Blog",
Description = "My Favorite Rants and Raves",
Link = new Uri("https://www.v2know.com"),
Copyright = "(c) 2019-" + DateTime.UtcNow.Year + " EKsumic",
Language = "en"
};
foreach (var item in Blogs.OrderByDescending(x => x.PublishTime))
{
var item1 = new Item()
{
Title = item.Title,
Body = item.Summary,
Link = new Uri("https://www.v2know.com/MainPage/PreView/" + item.Id.ToString()),
PublishDate = item.PublishTime,
Author = new WilderMinds.RssSyndication.Author() { Name = "EKsumic", Email = "[email protected]" }
};
item1.Categories.Add(Genre.SingleOrDefault(x => x.Id == item.GenreId).Name.ToString());
feed.Items.Add(item1);
}
var rss = feed.Serialize();
//Delete original XMLFile.xml
DeleteFileOrDirectory(_env.WebRootPath + "\\rss\\" + "XMLFile.xml");
//Continue
string filepath = _env.WebRootPath + "\\rss\\";
FileStream fs = new FileStream(filepath + "XMLFile.xml", FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.Write(rss);
sw.Flush();
sw.Close();
fs.Close();
return "RssFeed Update Success!";
}
Until now, I still haven't found any errors. I'm still trying to find...
In view of the successful use of feedly before, I think it is a problem that cloudflare is not updated in time. Because feedly should be a company in the United States, the server is in the United States, if no American users visit my website, the cloudflare node server should not be updated. This is what I think is most likely to happen.
Update on June 9,2020:
When I use feeder, the problem seems to disappear. It looks like an RSS reader problem. Maybe I just ran into some useless RSS readers. But it's also strange why other people's RSS feeds work, but mine don't? The only possibility lies in the format. Yes, I used other people's code for convenience. Maybe that's why other RSS readers can't read it.
But why?
Since my RSS feed still works, I don't want to investigate now because I feel like it might take a lot of time.
Let's talk about it later!
Update on June 13,2020:
OK, I'm sure it's the RSS reader's problem. There is no error in my code, you can try to use it.