RetrieveFeed() public method

Retrieves the specified feed.
public RetrieveFeed ( XmlReader xmlReader ) : IEnumerable
xmlReader System.Xml.XmlReader The to use to read the items from.
return IEnumerable
Esempio n. 1
0
        List<ArticleViewModel> IFeedService.GetFeedFor(Uri feedAddress)
        {
            var results = new List<ArticleViewModel>();

            var reader = new FeedReader(throwOnError: true);
            var articles = reader.RetrieveFeed(feedAddress.ToString());

            foreach (var article in articles)
            {
                results.Add(new ArticleViewModel()
                {
                    Title = article.Title,
                    Content = article.Title,
                    PublishDate = article.PublishDate
                });
            }

            return results;
        }
Esempio n. 2
0
 protected List<SimpleFeedReader.FeedItem> GetArticles()
 {
     var reader = new FeedReader();
     var items = reader.RetrieveFeed(Url);
     return items.ToList();
 }
Esempio n. 3
0
        private IEnumerable<FeedItem> RetrieveFeeds(IEnumerable<Feed> feeds, TimeSpan ttl)
        {
            var items = new List<FeedItem>();
            foreach (var f in feeds)
            {
                items.AddRange(
                    HttpRuntime.Cache.GetOrStore<IEnumerable<FeedItem>>(string.Format("feed_{0}_{1}", f.Language, f.Uri.ToLowerInvariant()), () =>
                    {
                        var reader = new FeedReader(new RobIIIFeedNormalizer());
                        return reader.RetrieveFeed(f.Uri);
                    }, ttl)
                );
            }

            return items.OrderByDescending(i => i.PublishDate);
        }
Esempio n. 4
0
 /// <summary>
 /// Checks for RSS feed updates, and posts on action
 /// </summary>
 public void RSSTracker(object sender, EventArgs e)
 {
     RSSTick.Close();
     int count = 0;
     var reader = new FeedReader();
     foreach (string item in Feeds)
     {
         var FeedItems = reader.RetrieveFeed(item);
         if ((
             (StoredFeeditems[count] != null) &
             (FeedItems != null) &
             (FeedItems.FirstOrDefault().Title.ToString() != StoredFeeditems[count])
             & (EnableRSS = true)
             ))
         {
             Log.Interface(FeedItems.FirstOrDefault().Uri.ToString());
             Bot.SteamFriends.SendChatRoomMessage(Groupchat, EChatEntryType.ChatMsg, FeedItems.FirstOrDefault().Title.ToString() + " " + FeedItems.FirstOrDefault().Uri.ToString());
         }
         StoredFeeditems[count] = FeedItems.FirstOrDefault().Title.ToString();
         count = count + 1;
     }
     RSSTimer();
 }