private void GetSrcLinks()
        {
            HtmlNodeCollection atts = m_Doc.DocumentNode.SelectNodes("//*[@src]");

            if (Equals(atts, null))
            {
                return;
            }

            Links = atts.
                    SelectMany(n => new[]
            {
                ParseLink(n, "src"),
            }).
                    Distinct().
                    ToArray();
        }
Exemplo n.º 2
0
        private List <(string title, List <string> topics)> GetWeekInfosLinq(HtmlNodeCollection weeks)
        {
            var antiDict = File.ReadAllLines("AntiDictionary.txt");

            return(weeks
                   .SelectMany(w => w.LastChild.ChildNodes)
                   .Select(w => (w.ChildNodes[0].InnerText,
                                 videoTopicRe.Matches(w.InnerText)
                                 .Select(m => m.Value.Substring(6, m.Value.Length - 7).Replace("&quot", "\""))
                                 .Where(s => !antiDict.Any(antiWord => s.IndexOf(antiWord, StringComparison.OrdinalIgnoreCase) >= 0))
                                 .ToList()))
                   .Where(tup => !(attestRe.IsMatch(tup.Item1))).ToList());

            /*return weeks
             *  .Select(w => w.LastChild.LastChild)
             *  .Select(w => (w.ChildNodes[0].InnerText,
             *      w.ChildNodes[1].InnerText.Split("More")[0]
             *      .Replace('\t', ' ').Split(". ").ToList()))
             *  .Where(tup => !(attestRe.IsMatch(tup.Item1))).ToList()
             *  .ToList();*/
        }
        private void GetLinks()
        {
            HtmlNodeCollection atts = _doc.DocumentNode.SelectNodes("//*[@background or @lowsrc or @src or @href or @action]");

            if (atts.IsNull())
            {
                Links = new string[0];
                return;
            }

            Links = atts.
                    SelectMany(n => new[]
            {
                ParseLink(n, "background"),
                ParseLink(n, "href"),
                ParseLink(n, "src"),
                ParseLink(n, "lowsrc"),
                ParseLink(n, "action")
            }).
                    Distinct().
                    ToArray();
        }