Пример #1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            List <Scrapings.DataTypes.WordWithYomikata> een = Scrapings.scrapeJishoDotOrg(textBox1.Lines.ToList()); // save to file

            List <string> save = new List <string>();

            foreach (var x in een)
            {
                string saveme = x.Word + " " + x.Yomikata + "\r\n";
                save.Add(saveme);
            }
            File.WriteAllLines(_SaveLocation + "\\alleWorden.txt", save);

            Scrapings.ScrapeForvo(_SaveLocation, een);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e) //test
        {
            List <string> ja = new List <string>();

            ja.Add("ご兄弟");
            Scrapings.scrapeJishoDotOrg(ja);

            HtmlWeb web           = new HtmlWeb();
            var     htmldocd      = web.Load("https://nl.forvo.com/search/" + "ご兄弟");
            var     resultd       = htmldocd.DocumentNode.SelectNodes("//*[contains(@class, 'play')]")[0];
            string  audioFileLink = "https://audio00.forvo.com/audios/mp3/" + Encoding.UTF8.GetString(Convert.FromBase64String(resultd.Attributes[2].Value.Split('\'').ToList().Where(x => x.Length > 20).ToList()[2]));

            using (WebClient wbc = new WebClient())
            {
                wbc.DownloadFile(audioFileLink, "金色" + " " + "blalalla" + ".mp3");
            }
        }