Last active
August 31, 2019 16:31
-
-
Save jeremypage/f46ffbc6400200f3690300cad0e708f6 to your computer and use it in GitHub Desktop.
Contensis: RSS and Atom feed readers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<control name="Atom feed reader" category="Trafford controls" showInMenu="true" viewingGroup="1"> | |
<properties> | |
<text name="FeedUrl" required="true" label="Feed URL"> | |
<parameters> | |
<parameter name="FeedUrl" value="http://intranet.trafford.gov.uk/Forum/feed.php" /> | |
</parameters> | |
</text> | |
</properties> | |
</control> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Xml | |
@using System.ServiceModel.Syndication | |
@{ | |
Atom10FeedFormatter formatter = new Atom10FeedFormatter(); | |
using (XmlReader reader = XmlReader.Create(Properties.FeedUrl)) | |
{ | |
formatter.ReadFrom(reader); | |
} | |
} | |
<ul class="forum-feed"> | |
@foreach (SyndicationItem Item in formatter.Feed.Items) | |
{ | |
<li class="forum-feed-item"> | |
<div class="forum-feed-item__title">@Item.Title.Text</div> | |
<div class="forum-feed-item__description">@Html.Raw(Item.Summary.Text)</div> | |
<div class="forum-feed-item__date">@Item.PublishDate.DateTime</div> | |
<div class="forum-feed-item__link"><a href="@Item.Links[0].Uri.ToString()">Link to article</a></div> | |
</li> | |
} | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<control name="RSS feed reader" category="Trafford controls" showInMenu="true" viewingGroup="1"> | |
<properties> | |
<text name="FeedUrl" required="true" label="Feed URL"> | |
<parameters> | |
<parameter name="FeedUrl" value="http://intranet.trafford.gov.uk/Forum/feed.php" /> | |
</parameters> | |
</text> | |
</properties> | |
</control> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Xml | |
@using System.ServiceModel.Syndication | |
@{ | |
Rss20FeedFormatter formatter = new Rss20FeedFormatter(); | |
using (XmlReader reader = XmlReader.Create(Properties.FeedUrl)) | |
{ | |
formatter.ReadFrom(reader); | |
} | |
} | |
<ul class="forum-feed"> | |
@foreach (SyndicationItem Item in formatter.Feed.Items) | |
{ | |
<li class="forum-feed-item"> | |
<div class="forum-feed-item__title">@Item.Title.Text</div> | |
<div class="forum-feed-item__description">@Html.Raw(Item.Summary.Text)</div> | |
<div class="forum-feed-item__date">@Item.PublishDate.DateTime</div> | |
<div class="forum-feed-item__link"><a href="@Item.Links[0].Uri.ToString()">Link to article</a></div> | |
</li> | |
} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment