Пример #1
0
 public string GetFriendlyUrlTitle(IRipper w, string url)
 {
     try
     {
         string       webPage      = w.GetWebPage("http://" + url);
         HtmlDocument htmlDocument = new HtmlDocument();
         string       str          = webPage;
         htmlDocument.LoadHtml(str);
         using (IEnumerator <HtmlNode> enumerator = ((IEnumerable <HtmlNode>)htmlDocument.get_DocumentNode().SelectNodes("//meta")).GetEnumerator())
         {
             while (((IEnumerator)enumerator).MoveNext())
             {
                 HtmlNode current = enumerator.Current;
                 if (current.get_Attributes().Contains("property") && !(current.get_Attributes().get_Item("property").get_Value() != "og:title"))
                 {
                     return(current.get_Attributes().get_Item("content").get_Value().Trim().Replace(" • Instagram photos and videos", ""));
                 }
             }
         }
         return((string)null);
     }
     catch (Exception ex)
     {
         return(url);
     }
 }
Пример #2
0
        private static List <Cookie> smethod_1(IRipper iripper_0, string string_0, string string_1)
        {
            string        url          = "https://www.tumblr.com/login";
            List <Cookie> list         = new List <Cookie>();
            string        webPage      = iripper_0.GetWebPage(url, ref list);
            HtmlDocument  htmlDocument = new HtmlDocument();
            string        str          = webPage;

            htmlDocument.LoadHtml(str);
            string string_0_1 = string.Empty;

            using (IEnumerator <HtmlNode> enumerator = ((IEnumerable <HtmlNode>)htmlDocument.get_DocumentNode().SelectNodes("//input")).GetEnumerator())
            {
                while (((IEnumerator)enumerator).MoveNext())
                {
                    HtmlNode current = enumerator.Current;
                    if (current.get_Attributes().Contains("name") && current.get_Attributes().get_Item("name").get_Value().Equals("form_key"))
                    {
                        string_0_1 = current.get_Attributes().get_Item("value").get_Value();
                    }
                }
            }
            TumblrLogin.smethod_0(iripper_0, ref list, string_0_1, string_0);
            iripper_0.PostWebPage(url, new NameValueCollection()
            {
                {
                    "determine_email",
                    string_0
                },
                {
                    "user[email]",
                    string_0
                },
                {
                    "user[password]",
                    string_1
                },
                {
                    "tumblelog[name]",
                    ""
                },
                {
                    "user[age]",
                    ""
                },
                {
                    "context",
                    "other"
                },
                {
                    "version",
                    "STANDARD"
                },
                {
                    "follow",
                    ""
                },
                {
                    "http_referer",
                    "https://www.tumblr.com/logout"
                },
                {
                    "form_key",
                    string_0_1
                },
                {
                    "seen_suggestion",
                    "0"
                },
                {
                    "used_suggestion",
                    "0"
                },
                {
                    "used_auto_suggestion",
                    "0"
                },
                {
                    "about_tumblr_slide",
                    ""
                },
                {
                    "random_username_suggestions",
                    "[\"DecadentAlpacaPerson\",\"CertainYouthNight\",\"BigAvenueObservation\",\"DarkPandaCherryblossom\",\"CyberKoalaLlama\"]"
                }
            }, ref list);
            return(list);
        }