예제 #1
0
        public RssChannel GetDocument(string url)
        {
            Feed feed = FeedManager.GetFeed(url);

            if (feed != null)
            {
                return(feed.Document.Channel);
            }

            return(new RssChannel());
        }
예제 #2
0
        protected void RegisterForSyndication()
        {
            string url = FeedUrl;

            if (string.IsNullOrEmpty(url))
            {
                throw new Exception("The widget does not have the proper feed settings. FeedUrl is null or empty");
            }

            Uri newUri;

            if (!Uri.TryCreate(url, UriKind.Absolute, out newUri))
            {
                throw new Exception("Invalid Url format. The url " + FeedUrl + " is not valid");
            }

            if (!FeedManager.RegisterFeed(FeedUrl))
            {
                throw new Exception("The feed " + FeedUrl + " could not be registered");
            }
        }
예제 #3
0
 protected RssChannel Document()
 {
     return(FeedManager.GetFeed(FeedUrl).Document.Channel);
 }