예제 #1
0
        private void GetFromPasteBin(string url)
        {
            var page = NetUtil.GetPageText(url);

            var title = page.Split(new[] { "<div class=\"paste_box_line1\" title=\"" }, StringSplitOptions.None)[1];

            Title = GetVal(title, '"');

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

            Author = GetVal(auth[1]);

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

            Description = $"Pastebin created on: {date}";
        }
예제 #2
0
        public TeamPasteInfo(string url)
        {
            URL = url;
            var isUri = Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute);

            if (!isUri)
            {
                return;
            }
            Source = GetSource(url);
            if (Source == PasteSource.None)
            {
                return;
            }

            url  = GetRawURL(url);
            Sets = NetUtil.GetPageText(url).Trim();
            LoadMetadata();
            Valid = true;
        }
예제 #3
0
        public SmogonSetList(PKM pk)
        {
            var baseURL = GetBaseURL(pk.GetType().Name);

            if (string.IsNullOrWhiteSpace(baseURL))
            {
                return;
            }

            var set = new ShowdownSet(pk);

            Species = GameInfo.GetStrings("en").Species[pk.Species];
            Form    = set.Form;

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

            Valid = true;
            ShowdownSpeciesName = GetShowdownName(Species, Form);

            LoadSetsFromPage();
        }
예제 #4
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);

            Valid = true;
            ShowdownSpeciesName = GetShowdownName(Species, psform);

            LoadSetsFromPage();
        }
예제 #5
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]);
        }