コード例 #1
0
        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}";
        }
コード例 #2
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();
        }
コード例 #3
0
        public static string GetMGDBDownloadURL()
        {
            var json_data = NetUtil.DownloadString(RepoReleaseURL);

            return(json_data.Split(new[] { "browser_download_url" }, StringSplitOptions.None)[1].Substring(3).Split('"')[0]);
        }