// Get dublin extension data
        private void GetDublinCoreExtension(DublinCoreMetadataTermsSyndicationExtensionContext DublinSource,
                                            AdvancedRssItem RssItemDest)
        {
            //TODO:we just use it for title, descripcion, creator and date if they don't exist

            //Title
            if (DublinSource.Title != null && RssItemDest.Title == null)
            {
                RssItemDest.Title = DublinSource.Title;
            }

            //Description
            if (DublinSource.Description != null && RssItemDest.Description == null)
            {
                RssItemDest.Description = DublinSource.Description;
            }

            //Creator
            if (DublinSource.Creator != null && RssItemDest.Author == null)
            {
                RssItemDest.Author = DublinSource.Creator;
            }

            //Date
            if (DublinSource.Date != null && RssItemDest.PubDate == null)
            {
                RssItemDest.PubDate = DublinSource.Date;
            }
        }
        // Get BasicGeo extension data
        private void SetBasicGeocodingExtension(AdvancedRssItem RssItemSource, RssItem RssItemDest)
        {
            BasicGeocodingSyndicationExtension GeoCoding = new BasicGeocodingSyndicationExtension();

            GeoCoding.Context.Longitude = (decimal)RssItemSource.Geolon;
            GeoCoding.Context.Latitude  = (decimal)RssItemSource.Geolon;

            RssItemDest.AddExtension(GeoCoding);
        }
        // Get slash extension data
        private void GetSlashCoreExtension(SiteSummarySlashSyndicationExtensionContext SlashSource,
                                           AdvancedRssItem RssItemDest)
        {
            //TODO:we just use it for comment number

            //Number of comment
            if (SlashSource.Comments >= 0)
            {
                RssItemDest.Commentnumber = SlashSource.Comments;
            }
        }
        // Get slash extension data
        private void SetSlashExtension(AdvancedRssItem RssItemSource, RssItem RssItemDest)
        {
            //TODO:we just use it for comment number

            //Number of comment
            if (RssItemSource.Commentnumber >= 0)
            {
                SiteSummarySlashSyndicationExtension SlashExtension = new SiteSummarySlashSyndicationExtension();
                SlashExtension.Context.Comments = RssItemSource.Commentnumber;
                RssItemDest.AddExtension(SlashExtension);
            }
        }
        // Get basic data for Item
        private void GetBasicItemData(RssItem RssItemSource, AdvancedRssItem RssItemDest)
        {
            //Title
            if (RssItemSource.Title != null)
            {
                RssItemDest.Title = RssItemSource.Title;
            }

            //Author
            if (RssItemSource.Author != null)
            {
                //TODO: can be extend width more data
                if (RssItemSource.Author != null)
                {
                    RssItemDest.Author = RssItemSource.Author;
                }
            }

            //Publiched date
            if (RssItemSource.PublicationDate != null)
            {
                RssItemDest.PubDate = RssItemSource.PublicationDate;
            }

            //Comment info (number isn't a correct rss tag but maybe util)
            if (RssItemSource.Comments != null)
            {
                RssItemDest.Commenturl = RssItemSource.Comments.ToString();
            }

            //Content of the RSS
            if (RssItemSource.Description != null)
            {
                RssItemDest.Description = RssItemSource.Description;
            }

            //TODO: Collection of enclosure
            //Enclosure (attachment)
            if (RssItemSource.Enclosures != null && RssItemSource.Enclosures.Count > 0)
            {
                RssItemDest.Enclosureurl  = RssItemSource.Enclosures[0].Url.AbsoluteUri;
                RssItemDest.Enclosuretype = RssItemSource.Enclosures[0].ContentType;
            }

            //Link of info
            if (RssItemSource.Link != null)
            {
                RssItemDest.Link = RssItemSource.Link.ToString();
            }
        }
        private AdvancedRssChannel GetRssChannelFromRss(Uri url)
        {
            AdvancedRssChannel Channel = new AdvancedRssChannel();

            //Argotic object declaration
            RssFeed ArgoticRssFeed = new RssFeed();

            //Load from uri
            try
            {
                ArgoticRssFeed.Load(url, null, null);
            }
            catch
            {
            }

            //Init Channel basic data
            GetBasicChannelData(ArgoticRssFeed.Channel, Channel);

            //Init data for each item
            foreach (RssItem item in ArgoticRssFeed.Channel.Items)
            {
                //Init basic data
                AdvancedRssItem RssItem = new AdvancedRssItem();
                GetBasicItemData(item, RssItem);

                //Extensions type content
                if (item.HasExtensions)
                {
                    //Dublin Core Extension
                    DublinCoreMetadataTermsSyndicationExtension BublinExtension =
                        (DublinCoreMetadataTermsSyndicationExtension)
                        item.FindExtension(DublinCoreMetadataTermsSyndicationExtension.MatchByType);
                    if (BublinExtension != null)
                    {
                        GetDublinCoreExtension(BublinExtension.Context, RssItem);
                    }

                    //Dublin Extension
                    DublinCoreMetadataTermsSyndicationExtension DublinExtension =
                        (DublinCoreMetadataTermsSyndicationExtension)
                        item.FindExtension(DublinCoreMetadataTermsSyndicationExtension.MatchByType);
                    if (DublinExtension != null)
                    {
                        GetDublinCoreExtension(DublinExtension.Context, RssItem);
                    }

                    //Slash Extension
                    SiteSummarySlashSyndicationExtension SlashExtension =
                        (SiteSummarySlashSyndicationExtension)
                        item.FindExtension(SiteSummarySlashSyndicationExtension.MatchByType);
                    if (SlashExtension != null)
                    {
                        GetSlashCoreExtension(SlashExtension.Context, RssItem);

                        /*-----------------------------------------------------------------------------------*/
                        /* TODO: Comment problem                                                             */
                        /* Arrangment for a stupid argotic buc, they wrote "coment" and no "comment" !!!!!!  */
                        /* The news module comment URL, it's the URL + #comments                             */
                        /*-----------------------------------------------------------------------------------*/
                        if (SlashExtension.Context.Comments >= 0 && RssItem.Commenturl == null)
                        {
                            RssItem.Commenturl = item.Link.AbsoluteUri + "#comments";
                        }
                        /*-----------------------------------------------------------------------------------*/
                    }

                    //Geo localization
                    BasicGeocodingSyndicationExtension GMLExtension =
                        (BasicGeocodingSyndicationExtension)
                        item.FindExtension(BasicGeocodingSyndicationExtension.MatchByType);
                    if (GMLExtension != null)
                    {
                        GetBasicGeocodingExtension(GMLExtension.Context, RssItem);
                    }

                    ////Yahoo media tag
                    YahooMediaSyndicationExtension YahooExtension =
                        (YahooMediaSyndicationExtension)item.FindExtension(YahooMediaSyndicationExtension.MatchByType);
                    if (YahooExtension != null)
                    {
                        RssItem.RssfeedItemsMedia = new List <AdvancedRssItemMedia>();
                        GetYahooExtension(YahooExtension.Context, RssItem.RssfeedItemsMedia);
                    }
                }

                Channel.RssItems.Add(RssItem);
            }

            return(Channel);
        }
 // Get BasicGeo extension data
 private void GetBasicGeocodingExtension(BasicGeocodingSyndicationExtensionContext GMLSource,
                                         AdvancedRssItem RssItemDest)
 {
     RssItemDest.Geolat = (float)GMLSource.Latitude;
     RssItemDest.Geolon = (float)GMLSource.Longitude;
 }
        // Get basic data for Item
        private void SetBasicItemData(AdvancedRssItem RssItemSource, RssItem RssItemDest)
        {
            //Title
            if (RssItemSource.Title != null)
            {
                RssItemDest.Title = RssItemSource.Title;
            }

            //Author
            if (RssItemSource.Author != "" && RssItemSource.Author != "")
            {
                RssItemDest.Author = RssItemSource.Author;
            }

            //Category
            if (RssItemSource.Category != null)
            {
                foreach (String item in RssItemSource.Category)
                {
                    RssItemDest.Categories.Add(new RssCategory(item));
                }
            }

            //Content of the RSS
            if (RssItemSource.Description != null)
            {
                RssItemDest.Description = RssItemSource.Description;
            }

            //Link of info
            if (RssItemSource.Link != null && RssItemSource.Link != "")
            {
                try
                {
                    RssItemDest.Link = new Uri(RssItemSource.Link);
                }
                catch
                {
                }
            }

            //Publiched date
            if (RssItemSource.PubDate != null)
            {
                RssItemDest.PublicationDate = RssItemSource.PubDate;
            }

            //Enclosure (attachment)
            if (RssItemSource.Enclosureurl != null && RssItemSource.Enclosureurl != "")
            {
                try
                {
                    string enclosMimeType = "";

                    if (RssItemSource.Enclosuretype != null)
                    {
                        enclosMimeType = RssItemSource.Enclosuretype;
                    }

                    RssEnclosure newEnclosure = new RssEnclosure(RssItemSource.Enclosurelength, enclosMimeType,
                                                                 new Uri(RssItemSource.Enclosureurl));

                    RssItemDest.Enclosures.Add(newEnclosure);
                }
                catch
                {
                }
            }

            //Comment info (number isn't a correct rss tag but maybe util)
            if (RssItemSource.Commenturl != null && RssItemSource.Commenturl != "")
            {
                try
                {
                    RssItemDest.Comments = new Uri(RssItemSource.Commenturl);
                }
                catch
                {
                }
            }
        }