Bot.Plugins.Base.Commands.WikipediaResponse.WikipediaResponse C# (CSharp) Method

WikipediaResponse() public method

Construct WikipediaResponse by parsing attributes from XML.
public WikipediaResponse ( string responseXml ) : System
responseXml string XML to parse
return System
        public WikipediaResponse(string responseXml)
        {
            var reader = new System.IO.StringReader(responseXml);
            XElement root = XElement.Load(reader);

            FullUrl = root.Descendants("page").First().Attribute("fullurl").Value;

            string article = root.Descendants("page").Descendants("extract").FirstOrDefault().Value;
            Article = article.Replace('\n', ' ');

            Title = root.Descendants("page").First().Attribute("title").Value;

            reader.Dispose();
        }

Same methods

WikipediaResponse::WikipediaResponse ( string title, string article, string fullUrl ) : System
WikipediaResponse