Check /index.xml when finding a feed when there are no other leads. Fix #235.

This commit is contained in:
Brent Simmons 2018-01-05 22:54:28 -08:00
parent 45f3f49a1f
commit 2938cc718d
1 changed files with 5 additions and 0 deletions

View File

@ -94,10 +94,15 @@ private extension FeedFinder {
if feedSpecifiers.isEmpty {
// Odds are decent its a WordPress site, and just adding /feed/ will work.
// Its also fairly common for /index.xml to work.
if let url = URL(string: urlString) {
let feedURL = url.appendingPathComponent("feed", isDirectory: true)
let wordpressFeedSpecifier = FeedSpecifier(title: nil, urlString: feedURL.absoluteString, source: .HTMLLink)
feedSpecifiers.insert(wordpressFeedSpecifier)
let indexXMLURL = url.appendingPathComponent("index.xml", isDirectory: false)
let indexXMLFeedSpecifier = FeedSpecifier(title: nil, urlString: indexXMLURL.absoluteString, source: .HTMLLink)
feedSpecifiers.insert(indexXMLFeedSpecifier)
}
}