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
Exemplo 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;
        }
Exemplo n.º 2
0
 protected List<SimpleFeedReader.FeedItem> GetArticles()
 {
     var reader = new FeedReader();
     var items = reader.RetrieveFeed(Url);
     return items.ToList();
 }
Exemplo 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);
        }
Exemplo 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();
 }