private void GetFromPokePaste(string url)
        {
            var htmldoc   = NetUtil.GetPageText(url);
            var pastedata = htmldoc.Split(new[] { "<aside>" }, StringSplitOptions.None)[1].Split(new[] { "</aside>" }, StringSplitOptions.None)[0];

            var title = pastedata.Split(new[] { "<h1>" }, StringSplitOptions.None);

            if (title.Length > 1)
            {
                Title = GetVal(title[1]);
            }

            var auth = pastedata.Split(new[] { "<h2>&nbsp;by" }, StringSplitOptions.None);

            if (auth.Length > 1)
            {
                Author = GetVal(auth[1]);
            }

            var desc = pastedata.Split(new[] { "<p>" }, StringSplitOptions.None);

            if (desc.Length > 1)
            {
                Description = GetVal(desc[1]);
            }
        }
        private void GetFromPasteBin(string url)
        {
            var page = NetUtil.GetPageText(url);

            var title = page.Split(new[] { "<h1>" }, StringSplitOptions.None)[1];

            Title = GetVal(title);

            var auth = page.Split(new[] { "<div class=\"username\">" }, StringSplitOptions.None)[1].Split('>');

            Author = GetVal(auth[0]);

            var datestr = auth[3];
            var date    = GetVal(datestr);

            Description = $"Pastebin created on: {date}";
        }
示例#3
0
        public SmogonSetList(PKM pk)
        {
            var baseURL = GetBaseURL(pk.GetType().Name);
            if (string.IsNullOrWhiteSpace(baseURL))
            {
                URL = Species = Form = ShowdownSpeciesName = Page = string.Empty;
                return;
            }

            var set = new ShowdownSet(pk);
            Species = GameInfo.GetStrings("en").Species[pk.Species];
            Form = ConvertFormToURLForm(set.Form, Species);
            var psform = ConvertFormToShowdown(set.Form, set.Species);

            URL = GetURL(Species, Form, baseURL);
            Page = NetUtil.GetPageText(URL);

            LetsGo = pk is PB7;
            Valid = true;
            ShowdownSpeciesName = GetShowdownName(Species, psform);

            LoadSetsFromPage();
        }