How do I get items from an RSS feed using .Net Core?
The following code doesn't appear to work:
open Microsoft.SyndicationFeedopen Microsoft.SyndicationFeed.Rss[<Test>]let ``Get links from iTunes RSS Feed`` () = let url = "http://www.pwop.com/feed.aspx?show=dotnetrocks&filetype=master&tags=F%23" use reader = XmlReader.Create(url) let feedReader = RssFeedReader(reader) let mutable linkTemplate = { Title= "" Url= "" } let links = async { let links = Collections.Generic.List<Link>() while feedReader.Read() |> Async.AwaitTask |> Async.RunSynchronously do match feedReader.ElementType with | SyndicationElementType.Link -> let item = feedReader.ReadLink() |> Async.AwaitTask |> Async.RunSynchronously let link = { linkTemplate with Title= item.Title; Url= item.Uri.AbsolutePath } links.Add(link) | _ -> () return links } |> Async.RunSynchronously reader.Close() System.Diagnostics.Debug.WriteLine(links.[0].Title) links.[0].Title |> should not' (equal "")
Specifically, items are read but there's no actual data after the read.