nmdias / FeedKit

An RSS, Atom and JSON Feed parser written in Swift
MIT License
1.19k stars 174 forks source link

Not able to parse some websites #132

Closed legolasW closed 1 year ago

legolasW commented 3 years ago

I tested the RSS feed below using the sample app, but unfortunately it gives no result.

http://feeds.bbci.co.uk/news/rss.xml

I'm a bit confused, as it seems to be parse some website and can't parse the result. Which type of Rss can FeedKit parse in particular?

a40yostudent commented 3 years ago
import Foundation
import FeedKit

let source = URL(string: "http://feeds.bbci.co.uk/news/rss.xml")!

let parser = FeedParser(URL: source)
let result = parser.parse()
var parsedFeed = RSSFeed()

switch result {
case .success(let feed):
    parsedFeed = feed.rssFeed!
case .failure(let error):
    print(error)
}

for feedItem in parsedFeed.items! {
    print(feedItem.link!)
}

A playground like this is working on my side, what kind of error do you see?

nmdias commented 1 year ago

Thank you for the issue @legolasW and thank you for helping @40yostudent