Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Is it possible to consume an ATOM feed using partial views, does anyone have any resources or able to point me in the write direction?
Demo ATOM feed - https://www.gov.uk/government/organisations/public-health-england.atom
Thanks
Hi Kyle,
Perhaps you could use this package to solve your task.
https://our.umbraco.org/projects/website-utilities/eyecatch-rss-feed-generator/
Hope this helps,
/Dennis
Hi Denis,
Thanks for providing this, I had been exploring this package, but as far as I could tell it seems to be for creating an RSS/ATOM feedback from the data in my own site. Where as I am looking at bringing in an ATOM feed from an external source.
I have been playing with the code from the following thread - https://our.umbraco.org/forum/developers/razor/27409-Consume-an-RSS-feed-in-Razor
Which has allowed me to bring in an RSS feed from BBC News http://feeds.bbci.co.uk/news/uk/rss.xml?edition=uk, but I cannot seem to find anything for an ATOM Feed.
I wonder whether anyone has been able to do this before using Umbraco?
I have managed to get some of the data for the ATOM FEED to display on the page using the following...
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = null; } <h1>RSS TEST</h1> <h2>Page Title: @Umbraco.Field("pageTitle")</h2> @using System.Xml @using System.ServiceModel.Syndication; @{ var feed = SyndicationFeed.Load(new XmlTextReader("https://www.gov.uk/government/organisations/public-health-england.atom")); } @foreach (var item in feed.Items) { <p><br /> <hr/> <b>Authors:</b> @item.Authors.ToString()<br/> <b>category:</b> @item.Categories.ToString()<br/> <b>content:</b> @item.Content.ToString()<br/> <b>contributor:</b> @item.Contributors.ToString()<br/> @*<b>link with rel="edit-media":</b> @item.EditMediaUri.ToString()<br/> <b>link with rel="edit":</b> @item.EditUri.Text<br/> *@ <b>id:</b> @item.Id.ToString()<br/> @*<b>xml:lang:</b> @item.Language.ToString()<br/> *@ <b>update:</b> @item.LastUpdatedTime.ToString("F")<br/> <b>link:</b> @item.Links.Text<br/> <b>published:</b> @item.PublishDate.ToString("F")<br/> @*<b>rights:</b> @item.Rights.ToString()<br/> <b>source:</b> @item.Source.ToString()<br/> *@ <b>summary:</b> @item.Summary.Text<br/> <b>title:</b> @item.Title.Text<br/> <b></b><br/> </p> }
But I am struggling with the formatting of the elements, I need to map to the Links element so I can add a link back to the original source.
I am struggling to find out how to obtain the data for this.
If anyone else is struggling with anything similar with ATOM FEEDS below is the code with displays the following:
Item URL
@using System.Xml @using System.ServiceModel.Syndication; @{ var feed = SyndicationFeed.Load(new XmlTextReader("https://www.gov.uk/government/organisations/public-health-england.atom")); } @foreach (var item in feed.Items) {
<p><strong>Title: </strong> @item.Title.Text</p> <p><strong>summary: </strong> @item.Summary.Text</p> <p><strong>Published: </strong> @item.PublishDate.ToString("F")<br/></p> <p><strong>id:</strong> @item.Id.ToString()</p> <p><strong>update:</strong> @item.LastUpdatedTime.ToString("F")<br/></p> <p><strong>Orignial Item URL:</strong> @item.Links.First().Uri<br/></p> <hr/>
<p><strong>Published: </strong> @item.PublishDate.ToString("F")<br/></p> <p><strong>id:</strong> @item.Id.ToString()</p> <p><strong>update:</strong> @item.LastUpdatedTime.ToString("F")<br/></p> <p><strong>Orignial Item URL:</strong> @item.Links.First().Uri<br/></p> <hr/>
}
I have been pulling my hair out with this one so I hope it helps someone else :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
ATOM Feed in Website
Hi,
Is it possible to consume an ATOM feed using partial views, does anyone have any resources or able to point me in the write direction?
Demo ATOM feed - https://www.gov.uk/government/organisations/public-health-england.atom
Thanks
Hi Kyle,
Perhaps you could use this package to solve your task.
https://our.umbraco.org/projects/website-utilities/eyecatch-rss-feed-generator/
Hope this helps,
/Dennis
Hi Denis,
Thanks for providing this, I had been exploring this package, but as far as I could tell it seems to be for creating an RSS/ATOM feedback from the data in my own site. Where as I am looking at bringing in an ATOM feed from an external source.
I have been playing with the code from the following thread - https://our.umbraco.org/forum/developers/razor/27409-Consume-an-RSS-feed-in-Razor
Which has allowed me to bring in an RSS feed from BBC News http://feeds.bbci.co.uk/news/uk/rss.xml?edition=uk, but I cannot seem to find anything for an ATOM Feed.
I wonder whether anyone has been able to do this before using Umbraco?
Thanks
I have managed to get some of the data for the ATOM FEED to display on the page using the following...
But I am struggling with the formatting of the elements, I need to map to the Links element so I can add a link back to the original source.
I am struggling to find out how to obtain the data for this.
If anyone else is struggling with anything similar with ATOM FEEDS below is the code with displays the following:
Item URL
@using System.Xml @using System.ServiceModel.Syndication; @{ var feed = SyndicationFeed.Load(new XmlTextReader("https://www.gov.uk/government/organisations/public-health-england.atom")); } @foreach (var item in feed.Items) {
}
I have been pulling my hair out with this one so I hope it helps someone else :)
is working on a reply...