当前位置: 首页>>代码示例>>C#>>正文


C# GlobusHttpHelper.postFormData方法代码示例

本文整理汇总了C#中BaseLib.GlobusHttpHelper.postFormData方法的典型用法代码示例。如果您正苦于以下问题:C# GlobusHttpHelper.postFormData方法的具体用法?C# GlobusHttpHelper.postFormData怎么用?C# GlobusHttpHelper.postFormData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseLib.GlobusHttpHelper的用法示例。


在下文中一共展示了GlobusHttpHelper.postFormData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SearchByCompanyWithFilter


//.........这里部分代码省略.........
                        string start = getOthLocCode.Substring(startindex).Replace("id\":", string.Empty);
                        int endindex = start.IndexOf(",");
                        string othccountrycode = start.Substring(0, endindex).Replace("\"", string.Empty);
                        SearchCriteria.Country = othccountrycode.Replace(":", "%3A");
                    }
                    catch { }

                }

                if (SearchCriteria.Relationship == "" && SearchCriteria.Country == "" && SearchCriteria.IndustryType == "" && SearchCriteria.CompanySize == "" && SearchCriteria.Follower == "" && SearchCriteria.Fortune1000 == "")
                {
                    //url = "http://www.linkedin.com/vsearch/c?keywords=" + _Keyword + "&openFacets=N,CCR,JO,I,CS,NFR,F&orig=FCTD";
                    url = "http://www.linkedin.com/vsearch/c?type=companies&keywords=" + _Keyword + "&orig=GLHD&pageKey=voltron_company_search_internal_jsp&search=Search";
                }
                else
                {
                    //url = "http://www.linkedin.com/vsearch/c?keywords=" + _Keyword + "&openFacets=N,CCR,JO,I,CS,NFR,F&f_CCR=" + SearchCriteria.Country + "&f_I=" + SearchCriteria.IndustryType + "&f_CS=" + SearchCriteria.CompanySize + "&f_NFR=" + SearchCriteria.Follower + "&f_N=" + SearchCriteria.Relationship + "&f_F=" + SearchCriteria.Fortune1000 + "&orig=FCTD";
                    url = "http://www.linkedin.com/vsearch/c?type=companies&keywords=" + _Keyword + "&orig=GLHD&openFacets=N,CCR,JO,I,CS,NFR,F&f_CCR=" + SearchCriteria.Country + "&f_I=" + SearchCriteria.IndustryType + "&f_CS=" + SearchCriteria.CompanySize + "&f_NFR=" + SearchCriteria.Follower + "&f_N=" + SearchCriteria.Relationship + "&f_F=" + SearchCriteria.Fortune1000 + "";
                }

               string CompanySearchGetRequest = HttpHelper.getHtmlfromUrl1(new Uri(url));

               //Temporosy code for client
               //GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Comp Scpr Pagesource 2 >>>> " + CompanySearchGetRequest, Globals.Path_LinkedinCompanyScrapperPagesource);

                List<string> lstCompanyUrls = GettingAllUrlswithCompanyFilter(CompanySearchGetRequest);

                ////// call to GetDataFromCompanyURL
                GetDataFromCompanyURLWithFilter(ref HttpHelper, lstCompanyUrls);

                // call to get page no
                int pagenumber = GetPageNo(CompanySearchGetRequest);

                try
                {
                    LogScrap("[ " + DateTime.Now + " ] => [ Total Urls : " + pagenumber.ToString() + " ]");
                    pagenumber = int.Parse(pagenumber.ToString())/10 + 1;
                }
                catch (Exception)
                {

                }
                //pagenumber = (pagenumber / 10) - 1;

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;

                if (pagenumber > 1)
                {
                    try
                    {
                        string posturl = "http://www.linkedin.com/vsearch/c?keywords=" + _Keyword + "&orig=FCTD";

                      for (int s = 2; s <= pagenumber; s++)
                        {
                            try
                            {
                                //l%26T
                                if (_Keyword.Contains("&"))
                                {
                                    _Keyword = _Keyword.Replace("&", "%26");

                                }

                                string PostDAta = "&f_CCR=" + SearchCriteria.Country + "&f_I=" + SearchCriteria.IndustryType + "&f_CS=" + SearchCriteria.CompanySize + "&f_NFR=" + SearchCriteria.Follower + "&f_N=" + SearchCriteria.Relationship + "&f_F=" + SearchCriteria.Fortune1000 + "&page_num=" + s + "&pt=companies";
                                string Responses = HttpHelper.postFormData(new Uri(posturl), PostDAta);

                                //Temporosy code for client
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Comp Scpr Pagesource 2 >>>> " + Responses, Globals.Path_LinkedinCompanyScrapperPagesource);

                                List<string> lstCompanyURLs = GettingAllUrlswithCompanyFilter(Responses);

                                if (lstCompanyURLs.Count == 0)
                                {
                                    lstCompanyURLs = GettingAllUrlswithCompanyFilter(Responses);
                                }

                                // call to GetDataFromCompanyURL
                                GetDataFromCompanyURLWithFilter(ref HttpHelper, lstCompanyURLs);
                            }
                            catch { }
                        }
                    }
                    catch
                    {
                    }
                }

                string getsize = string.Empty;
                //obj_NewHireexcel.WritedataIntoExcel(Workbooks, Workbook, ComapanyName, link, industry, companysize, website, Founded, DateTime.Now.ToString(), Token1, Token2, Token3, Token4, starttime.ToString());
                try
                {
                    // getsize = companysize.Replace("employees", string.Empty).Trim();
                }
                catch { }
            }
            catch { }

            LogScrap("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED With UserName : " + SearchCriteria.LoginID + " ]");
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:LinkedinSearch.cs

示例2: ScarppLinkedinDataByPageNumber

        private List<string> ScarppLinkedinDataByPageNumber(int pagerecords, ref GlobusHttpHelper HttpHelper, string Pagesource, string LastName, string countrycd, string postalcd, string distance, string indstrycd)
        {
            List<string> lstRecordurl = new List<string>();
            try
            {
                string ResponseForPremiumAcc = Pagesource;
                int pagenumber = (pagerecords / 10) + 1;// (pagerecords / 10) - 1;

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;
                string PostRequestURL = string.Empty;
                string PostdataForPagination = string.Empty;
                string PostResponce = string.Empty;
                if (pagenumber >= 1)//(pagenumber > 1)
                {
                    for (int i = 1; i <= pagenumber; i++)
                    {
                        PostRequestURL = string.Empty;
                        PostdataForPagination = string.Empty;
                        PostResponce = string.Empty;
                        //if (SearchCriteria.starter)
                        {
                            // #region loop

                            if (ResponseForPremiumAcc.Contains("Account Type:</span> Basic"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                    //PostdataForPagination = "keywords=" + _Keyword + "&searchLocationType=Y&search=&pplSearchOrigin=GLHD&viewCriteria=2&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=CC%2CN%2CG";//"fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&countryCode=" + SearchCriteria.Country + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }
                            }

                            else if (ResponseForPremiumAcc.Contains(""))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                    //PostdataForPagination = "keywords=" + _Keyword + "&searchLocationType=Y&search=&pplSearchOrigin=GLHD&viewCriteria=2&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=CC%2CN%2CG";//"fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&countryCode=" + SearchCriteria.Country + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    if (string.IsNullOrEmpty(PostResponce))
                                    {
                                        PostRequestURL = "http://www.linkedin.com/search/hits";
                                        //PostRequestURL = "http://www.linkedin.com/vsearch/p?";
                                        PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                        //PostdataForPagination = "keywords=" + _Keyword + "&searchLocationType=Y&search=&pplSearchOrigin=GLHD&viewCriteria=2&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=CC%2CN%2CG";//"fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&countryCode=" + SearchCriteria.Country + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                        PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    }
                                }
                                catch { }

                            }
                            else if (ResponseForPremiumAcc.Contains("Account Type:</span> Executive"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    //PostdataForPagination = "fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&countryCode=" + SearchCriteria.Country + "&keepFacets=keepFacets&I=" + SearchCriteria.IndustryType + "&SE=" + SearchCriteria.SeniorLevel + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=N%2CCC%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=N%2CCC%2CI";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";

                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }

                            }

                            if (PostResponce.Contains("/profile/view?id"))
                            {

                                List<string> PageSerchUrl = ChilkatBasedRegex.GettingAllUrls(PostResponce, "profile/view?id");
                                if (PageSerchUrl.Count == 0)
                                {
                                    string[] Url_Split = Regex.Split(PostResponce, "link_nprofile_view_3");
                                    foreach(string item in Url_Split)
                                    {
                                        if (!item.Contains("<!DOCTYPE html>"))
                                        {
                                            try
                                            {
                                                int startIndex = item.IndexOf("\":\"");
                                                string Start = item.Substring(startIndex).Replace("\":\"", string.Empty);
                                                int endIndex = Start.IndexOf("\",\"");
                                                string End = Start.Substring(0, endIndex).Replace("\",\"", string.Empty).Trim();
                                                PageSerchUrl.Add(End);
                                            }
                                            catch
                                            { }
                                        }
                                    }
                                }

                                if (PageSerchUrl.Count == 0)
                                {

                                    //Log("On the basis of you Account you can able to see " + RecordURL.Count + "Results");
                                    break;
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:StartLinkedinScrapping.cs

示例3: MultiPartImageUpload

        public bool MultiPartImageUpload(ref GlobusHttpHelper httpHelper, string Username, string Password, string localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword)
        {
            /////Login to FB

            ////string valueLSD = "name=" + "\"lsd\"";

            int intProxyPort = 80;

            Regex IdCheck = new Regex("^[0-9]*$");

            if (!string.IsNullOrEmpty(proxyPort) && IdCheck.IsMatch(proxyPort))
            {
                intProxyPort = int.Parse(proxyPort);
            }
            //string pageSource = string.Empty;
            //try
            //{
            //    pageSource = getHtmlfromUrlProxy(new Uri("https://www.facebook.com/login.php"), proxyAddress, intProxyPort, proxyUsername, proxyPassword);
            //    //int startIndex = pageSource.IndexOf(valueLSD) + 18;
            //}
            //catch { }
            //string value = GlobusHttpHelper.GetParamValue(pageSource, "lsd");
            string ResponseLogin = string.Empty;
            try
            {
            //    ResponseLogin = postFormData(new Uri("https://www.facebook.com/login.php?login_attempt=1"), "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "&locale=en_US&email=" + Username.Split('@')[0] + "%40" + Username.Split('@')[1] + "&pass=" + Password + "&persistent=1&default_persistent=1&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "");

                ResponseLogin = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com"));
            }
            catch { }
            ///Setting Post Data Params...

            string userId = GlobusHttpHelper.Get_UserID(ResponseLogin);

            if (string.IsNullOrEmpty(userId) || userId == "0" || userId.Length < 3)
            {
                GlobusLogHelper.log.Info("Please Check The Account : " + Username);
                GlobusLogHelper.log.Debug("Please Check The Account : " + Username);

                return false;
            }

            string pgSrc_Profile = string.Empty;
            try
            {
                pgSrc_Profile = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/profile.php?id=" + userId + ""));
            }
            catch { }
            string profileSource = string.Empty;
            try
            {
                profileSource = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/ajax/timeline/profile_pic_selector.php?profile_id=" + userId + "&__a=1&__user=" + userId + ""));
            }
            catch { }


            //GlobusHttpHelper httpHelper = new GlobusHttpHelper();
            /////Get User ID
            //ProfileIDExtractor idExtracter = new ProfileIDExtractor();
            //idExtracter.ExtractFriendIDs(ref httpHelper, ref userId);


            string fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
            if (string.IsNullOrEmpty(fb_dtsg))
            {
                fb_dtsg = GlobusHttpHelper.ParseJson(ResponseLogin, "fb_dtsg");
            }


            string last_action_id = GlobusHttpHelper.ParseJson(pgSrc_Profile, "last_action_id");

            if (!Utils.IsNumeric(last_action_id))
            {
                last_action_id = "0";
            }

            string postData = "last_action_id=" + last_action_id + "&fb_dtsg=" + fb_dtsg + "&__user=" + userId + "&phstamp=165816810252768712174";
            string res = string.Empty;
            try
            {
                res = httpHelper.postFormData(new Uri("https://www.facebook.com/ajax/mercury/thread_sync.php?__a=1"), postData);
            }
            catch { }
            NameValueCollection nvc = new NameValueCollection();
            //nvc.Add("post_form_id", post_form_id);
            nvc.Add("fb_dtsg", fb_dtsg);
            nvc.Add("id", userId);
            nvc.Add("type", "profile");
            //nvc.Add("return", "/ajax/profile/picture/upload_iframe.php?pic_type=1&id=" + userId);
            nvc.Add("return", "/ajax/timeline/profile_pic_upload.php?pic_type=1&id=" + userId);

            //UploadFilesToRemoteUrl("http://upload.facebook.com/pic_upload.php ", new string[] { @"C:\Users\Globus-n2\Desktop\Windows Photo Viewer Wallpaper.jpg" }, "", nvc);
            //HttpUploadFile("http://upload.facebook.com/pic_upload.php ", localImagePath, "file", "image/jpeg", nvc);
            if (HttpUploadFile("https://upload.facebook.com/pic_upload.php ", localImagePath, "pic", "image/jpeg", nvc, proxyAddress, intProxyPort, proxyUsername, proxyPassword))
            //if (HttpUploadFile("http://upload.facebook.com/pic_upload.php ", localImagePath, "file", "image/jpeg", nvc, proxyAddress, intProxyPort, proxyUsername, proxyPassword))
            {
                return true;
            }
            return false;

//.........这里部分代码省略.........
开发者ID:sumitglobussoft,项目名称:Instagram-PVA-BOT,代码行数:101,代码来源:GlobusHttpHelper.cs

示例4: PostFinalMsgGroupMember_1By1


//.........这里部分代码省略.........
                                         }
                                         if (preventMsgGlobal)
                                         {
                                             try
                                             {
                                                 string Querystring = "Select MsgFrom,MsgToId,MsgTo,MsgGroupId,MsgGroupName,MsgSubject,MsgBody From tb_ManageMsgGroupMem Where MsgToId = " + connId + "";
                                                 ds = DataBaseHandler.SelectQuery(Querystring, "tb_ManageMsgGroupMem");
                                             }
                                             catch { }
                                         }

                                         try
                                         {

                                             if (ds.Tables.Count > 0)
                                             {
                                                 if (ds.Tables[0].Rows.Count > 0)
                                                 {

                                                     PostMessage = "";
                                                     ResponseStatusMsg = "Already Sent";

                                                 }
                                                 else
                                                 {
                                                     if (ds_bList.Tables.Count > 0 && ds_bList.Tables[0].Rows.Count > 0)
                                                     {
                                                         Log("[ " + DateTime.Now + " ] => [ User: " + ContactName + " is Added BlackListed List For Send Messages Pls Check ]");
                                                         ResponseStatusMsg = "BlackListed";
                                                     }
                                                     else
                                                     {
                                                         PostMessage = "csrfToken=" + csrfToken + "&subject=" + Uri.EscapeDataString(msg.ToString()) + "&body=" + Uri.EscapeDataString(tempBody.ToString()) + "&submit=Send+Message&fromName=" + Uri.EscapeDataString(FromEmailNam) + "&showRecipeints=showRecipeints&fromEmail=" + FromemailId + "&connectionIds=" + connId + "&connectionNames=&allowEditRcpts=true&addMoreRcpts=false&openSocialAppBodySuffix=&st=&viewerDestinationUrl=&contentType=MEBC&groupID=" + grpId + "";
                                                         ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/groupMsg"), PostMessage);
                                                     }
                                                 }
                                             }
                                             else
                                             {
                                                 if (ds_bList.Tables.Count > 0)
                                                 {
                                                     if (ds_bList.Tables[0].Rows.Count > 0)
                                                     {

                                                         Log("[ " + DateTime.Now + " ] => [ User: " + ContactName + " is Added BlackListed List For Send Messages Pls Check ]");
                                                         ResponseStatusMsg = "BlackListed";
                                                     }
                                                     else
                                                     {
                                                         PostMessage = "csrfToken=" + csrfToken + "&subject=" + Uri.EscapeDataString(msg.ToString()) + "&body=" + Uri.EscapeDataString(tempBody.ToString()) + "&submit=Send+Message&fromName=" + Uri.EscapeDataString(FromEmailNam) + "&showRecipeints=showRecipeints&fromEmail=" + FromemailId + "&connectionIds=" + connId + "&connectionNames=&allowEditRcpts=true&addMoreRcpts=false&openSocialAppBodySuffix=&st=&viewerDestinationUrl=&contentType=MEBC&groupID=" + grpId + "";
                                                         ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/groupMsg"), PostMessage);
                                                     }
                                                 }
                                             }
                                         }
                                         catch (Exception)
                                         {
                                                 //PostMessage = "csrfToken=" + csrfToken + "&subject=" + Uri.EscapeDataString(msg.ToString()) + "&body=" + Uri.EscapeDataString(tempBody.ToString()) + "&submit=Send+Message&showRecipeints=showRecipeintsfromName=" + Uri.EscapeDataString(FromEmailNam) + "&fromEmail=" + FromemailId + "&connectionIds=" + connId + "&connectionNames=&allowEditRcpts=true&addMoreRcpts=false&openSocialAppBodySuffix=&st=&viewerDestinationUrl=&contentType=MEBC&groupID=" + grpId + "";
                                                 //ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/groupMsg"), PostMessage);
                                         }

                                         if ((!ResponseStatusMsg.Contains("Your message was successfully sent.") && !ResponseStatusMsg.Contains("Already Sent")) && (!ResponseStatusMsg.Contains("Se ha enviado tu mensaje satisfactoriamente") && !ResponseStatusMsg.Contains("Ya ha sido enviada") && !ResponseStatusMsg.Contains("Uw bericht is verzonden")))
                                         {

                                             if (ResponseStatusMsg.Contains("Already Sent") || (ResponseStatusMsg.Contains("Ya ha sido enviada") || (ResponseStatusMsg.Contains("BlackListed"))))
                                             {
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:MessageGroupMember.cs

示例5: ScarppLinkedinDataByPageNumber

        private List<string> ScarppLinkedinDataByPageNumber(int pagerecords, ref GlobusHttpHelper HttpHelper, string Pagesource, string indstrycd, string postalcd, string countrycd)
        {
            List<string> lstRecordurl = new List<string>();
            try
            {
                string ResponseForPremiumAcc = Pagesource;
                int pagenumber = (pagerecords / 10) + 1;

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;
                string PostRequestURL = string.Empty;
                string PostdataForPagination = string.Empty;
                string PostResponce = string.Empty;
                if (pagenumber >= 1)
                {
                    for (int i = 1; i <= pagenumber; i++)
                    {
                        PostRequestURL = string.Empty;
                        PostdataForPagination = string.Empty;
                        PostResponce = string.Empty;
                        {

                            if (ResponseForPremiumAcc.Contains("Account Type:</span> Basic"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }
                            }

                            else if (ResponseForPremiumAcc.Contains(""))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    if (string.IsNullOrEmpty(PostResponce))
                                    {
                                        PostRequestURL = "http://www.linkedin.com/search/hits";
                                        PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                        PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    }
                                }
                                catch { }

                            }
                            else if (ResponseForPremiumAcc.Contains("Account Type:</span> Executive"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "lname=" + lastName + "&searchLocationType=I&countryCode=" + countrycd + "&postalCode=" + postalcd + "&distance=" + distance + "&keepFacets=keepFacets&facet_I=" + indstrycd + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=I%2CCC%2CN%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=I%2CCC%2CN";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }

                            }

                            if (PostResponce.Contains("/profile/view?id"))
                            {

                                List<string> PageSerchUrl = ChilkatBasedRegex.GettingAllUrls(PostResponce, "profile/view?id");
                                if (PageSerchUrl.Count == 0)
                                {
                                    break;
                                }
                                foreach (string item in PageSerchUrl)
                                {
                                    try
                                    {
                                        {
                                            if (item.Contains("authType=") && item.Contains("pp_profile_name_link"))
                                            {

                                                try
                                                {
                                                    if (item.Contains("//www.linkedin.com"))
                                                    {
                                                        string urlSerch = item;
                                                        lstRecordurl.Add(urlSerch);
                                                        lstRecordurl = lstRecordurl.Distinct().ToList();
                                                    }
                                                    else
                                                    {
                                                        string urlSerch = "https://www.linkedin.com" + item;
                                                        lstRecordurl.Add(urlSerch);
                                                        lstRecordurl = lstRecordurl.Distinct().ToList();
                                                    }
                                                }
                                                catch { }
                                            }
                                        }
                                    }
                                    catch
                                    {
                                    }
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:LinkedInScraperMultipleExcelInput.cs

示例6: StartCampaignInBoardProGetDataWithPagination


//.........这里部分代码省略.........
                    pagenumber = 2;
                }

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;

                if (pagenumber >= 1)
                {
                    _HttpHelper = HttpHelper;

                    //new Thread(() =>
                   // {
                        if (SearchCriteria.starter)
                        {
                            //string CheckString = "CampaignScraper" + FileName;
                            //finalUrlCollection(RecordURL);

                        }

                   // }).Start();

                    for (int i = 1; i <= pagenumber; i++)
                    {
                        if (SearchCriteria.starter)
                        {
                            #region loop

                            if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Basic"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "keywords=" + Uri.EscapeDataString(Keyword) + "&title=" + Uri.EscapeDataString(Title) + "&fname=" + FirstName + "&lname=" + LastName + "&searchLocationType=" + Location + "&f_FG=" + Groups + "&companyScope=" + CompanyValue + "&countryCode=" + Country + "&company=" + Company + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    //Temporosy code for client
                                    //GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 3 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);

                                }
                                catch { }
                            }
                            else if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Executive"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "keywords=" + Uri.EscapeDataString(Keyword) + "&title=" + Uri.EscapeDataString(Title) + "&fname=" + FirstName + "&lname=" + LastName + "&searchLocationType=" + Location + "&f_FG=" + Groups + "&companyScope=" + CompanyValue + "&countryCode=" + Country + "&keepFacets=keepFacets&I=" + IndustryType + "&SE=" + SeniorLevel + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=N%2CCC%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=N%2CCC%2CI";

                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    //Temporosy code for client
                                    //GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 3 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);
                                }
                                catch { }
                            }
                            else if (ResponseWallPostForPremiumAcc.Contains("openAdvancedForm=true"))
                            {
                                PostRequestURL = "http://www.linkedin.com/vsearch/p?";
                                PostdataForPagination = "keywords=" + Uri.EscapeDataString(Keyword) + "&title=" + Uri.EscapeDataString(Title) + "&titleScope=" + TitleValue + "&firstName=" + FirstName + "&lastName=" + LastName + "&postalCode=" + PostalCode + "&openAdvancedForm=true&companyScope=" + CompanyValue + "&locationType=" + Location + "&f_FG=" + Groups + "&countryCode=" + Country + "&company=" + Company + "&distance=" + within + "&f_N=" + Relationship + "&f_G=" + LocationArea + "&f_I=" + IndustryType + "&f_TE=" + YearsOfExperience + "&f_FA=" + Function + "&f_SE=" + SeniorLevel + "&f_P=" + IntrestedIn + "&f_CS=" + CompanySize + "&f_F=" + Fortune1000 + "&f_DR=" + RecentlyJoined + "&orig=ADVS&page_num=" + i + "";
                                PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                //Temporosy code for client
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 4 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);
                            }
                            else
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:frmCampaignScraper.cs

示例7: PostAttachLinkGroupUpdate


//.........这里部分代码省略.........
                         if (contentTitle.Contains("#"))
                         {
                             contentTitle = contentTitle.Replace("and", "&");
                             contentTitle = Uri.EscapeDataString(contentTitle);
                         }

                     }
                     catch { }

                     string contentSummary = string.Empty;
                     try
                     {
                         int StartinConSumm = GetStatus.IndexOf("share-view-summary\">");
                         string startConSumm = GetStatus.Substring(StartinConSumm);
                         int EndIndexConSumm = startConSumm.IndexOf("</span>");
                         string EndConSumm = startConSumm.Substring(0, EndIndexConSumm).Replace("value\":", "").Replace("\"", "");
                         contentSummary = EndConSumm.Replace("\"", string.Empty).Replace("\n", string.Empty).Replace("share-view-summary", string.Empty).Replace("id=", string.Empty).Replace(">", string.Empty).Replace("</span<a href=#", string.Empty).Trim();
                         contentSummary = contentSummary.Replace(",", "%2C").Replace(" ", "%20");

                         if (contentSummary.Contains("#"))
                         {
                             contentSummary = contentSummary.Replace("and", "&");
                             contentSummary = Uri.EscapeDataString(contentSummary);
                         }
                     }
                     catch { }

                     string PostAttachLink = string.Empty;
                     string ResponseStatusMsg = string.Empty;

                     try
                     {
                         PostAttachLink = "csrfToken=" + csrfToken + "&postTitle=&postText=&pollChoice1-ANetPostForm=&pollChoice2-ANetPostForm=&pollChoice3-ANetPostForm=&pollChoice4-ANetPostForm=&pollChoice5-ANetPostForm=&pollEndDate-ANetPostForm=0&contentImageCount=" + ImgCount + "&contentImageIndex=0&contentImage=" + LogoUrl + "&contentEntityID=" + EntityId + "&contentUrl=" + ReqUrl + "&contentTitle=" + contentTitle + "&contentSummary=" + contentSummary + "&contentImageIncluded=true&%23=&gid=" + Gid + "&postItem=&ajax=true&tetherAccountID=&facebookTetherID=";
                         ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/groups"), PostAttachLink);
                     }
                     catch { }

                             string CSVHeader = "UserName" + "," + "HeaderPost" + "," + "Details Post" + "," + "ToGroup";

                             if (ResponseStatusMsg.Contains("SUCCESS") || ResponseStatusMsg.Contains("Accept  the description According to you"))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ Attach Link : " + PostGrpAttachLink + " Added Successfully on Group : " + grpDisplay[2] + " ]");

                                 string CSV_Content = user + "," + PostGrpAttachLink + "," + PostGrpAttachLink + "," + grpDisplay[2];
                                 CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_GroupUpdates);

                             }
                             else if (ResponseStatusMsg.Contains("Your request to join is still pending"))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ Your membership is pending approval on a Group:" + grpDisplay[2] + " ]");
                                 Log("[ " + DateTime.Now + " ] => [ Attach Link : " + PostGrpAttachLink + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ]");

                                 GlobusFileHelper.AppendStringToTextfileNewLine("Your membership is pending approval on a Group:" + grpDisplay[2], Globals.path_GroupUpdate);
                                 GlobusFileHelper.AppendStringToTextfileNewLine("Message Header: " + PostGrpAttachLink + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ", Globals.path_GroupUpdate);
                                 GlobusFileHelper.AppendStringToTextfileNewLine("Message More Details: " + PostGrpAttachLink + " Not Posted on Group:" + grpDisplay[2] + " Because Your membership is pending for approval. ", Globals.path_GroupUpdate);
                             }
                             else if (ResponseStatusMsg.Contains("Your post has been submitted for review"))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ Message Header Posted : " + PostGrpAttachLink + " Successfully on Group : " + grpDisplay[2] + " ]");
                                 Log("[ " + DateTime.Now + " ] => [ Your post has been submitted for review ]");
                                 string CSV_Content = user + "," + PostGrpAttachLink + "," + PostGrpAttachLink + "," + grpDisplay[2];

                             }

                             else if (ResponseStatusMsg.Contains("Error"))
                             {
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:GroupUpdate.cs

示例8: UpdateStatusUsingAllurl

        public void UpdateStatusUsingAllurl(ref GlobusHttpHelper HttpHelper, int mindelay, int maxdelay)
        {
            try
            {
                string csrfToken = string.Empty;
                string sourceAlias = string.Empty;
                string ImgCount = string.Empty;
                string LogoUrl = string.Empty;
                string mentioned = string.Empty;
                string EntityId = string.Empty;
                string contentTitle = string.Empty;
                string contentSummary = string.Empty;
                string progressId = string.Empty;

                string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));
                if (pageSource.Contains("csrfToken"))
                {
                    csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 100);
                    string[] Arr = csrfToken.Split('&');
                    csrfToken = Arr[0];
                    csrfToken = csrfToken.Replace("csrfToken=", "");
                    csrfToken = csrfToken.Replace("%3A", ":");
                }
                if (pageSource.Contains("sourceAlias"))
                {
                    sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                    string[] ArrsourceAlias = sourceAlias.Split('"');
                    sourceAlias = ArrsourceAlias[2];
                }

                if (pageSource.Contains("X-Progress-ID"))
                {
                    progressId = pageSource.Substring(pageSource.IndexOf("X-Progress-ID"), 100);
                    string[] ArrsprogressId = progressId.Split('"');
                    progressId = ArrsprogressId[0].Replace("X-Progress-ID=", string.Empty).Replace("=",string.Empty);
                }
                string aaa = "lite/web-action-track?csrfToken=" + csrfToken +"";
                string post = HttpHelper.postFormData(new Uri("http://www.linkedin.com/"),aaa);

                string post1 = "X-Progress-ID=" + progressId + "&iframe_jsonp=true&window_post=true&post_window=parent&jsonp_callback=SlideshareUploader"+progressId;
                string pageSource1 = HttpHelper.postFormDataRef(new Uri("http://slideshare.www.linkedin.com/upload?"), post1, "http://www.linkedin.com/", csrfToken,"");
               // string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387628141050&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                try
                {
                    mentioned = "%5B%5D";
                }
                catch { }

                try
                {

                    string ReqUrl = Post;
                    //ReqUrl = ReqUrl.Replace(":", "%3A").Replace("//", "%2F%2F");
                   // string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387606658969&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                    csrfToken = csrfToken.Replace(":","%3A");
                    string postUrlData = " https://www.linkedin.com/lite/web-action-track?csrfToken=" + csrfToken;
                    string postData = "pkey=member-home&tcode=hp-shr-actvt-msg&plist=";
                    string ResponseStatusMsg1 = HttpHelper.postFormData(new Uri(postUrlData), postData);
                    string pageSource11 = "";
                    //string GetStatus = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/share?getPreview=&url=" + ReqUrl));
                    //string GetStatus = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387606658969&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                   /* try
                    {
                        int StartinImgCnt = GetStatus.IndexOf("current");
                        string startImgCnt = GetStatus.Substring(StartinImgCnt);
                        int EndIndexImgCnt = startImgCnt.IndexOf("</span>");
                        string EndImgCnt = startImgCnt.Substring(0, EndIndexImgCnt).Replace("value\":", "").Replace("\"", "");
                        ImgCount = EndImgCnt.Replace("current", string.Empty).Replace(">", string.Empty);
                    }
                    catch
                    {
                        ImgCount = "0";
                    }

                    try
                    {
                        int StartinImgUrl = GetStatus.IndexOf("url");
                        string startImgUrl = GetStatus.Substring(StartinImgUrl);
                        int EndIndexImgUrl = startImgUrl.IndexOf("\"");
                        string EndImgUrl = startImgUrl.Substring(0, EndIndexImgUrl).Replace("value\":", "").Replace("\"", "");
                        LogoUrl = EndImgUrl.Replace("url=", string.Empty).Trim();
                    }
                    catch
                    {
                        LogoUrl = "false";
                    }

                    try
                    {
                        int StartinEntityId = GetStatus.IndexOf("data-entity-id");
                        string startEntityId = GetStatus.Substring(StartinEntityId);
                        int EndIndexEntityId = startEntityId.IndexOf("data-entity-url");
                        string EndEntityId = startEntityId.Substring(0, EndIndexEntityId).Replace("value\":", "").Replace("\"", "");
                        EntityId = EndEntityId.Replace("\"", string.Empty).Replace("data-entity-id", string.Empty).Replace("=", string.Empty).Trim();
                    }
                    catch { }

                    try
                    {
                        int StartinContent = GetStatus.IndexOf("share-view-title");
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:StatusUpdate.cs

示例9: PostFollowCompanyUsingUrl

        public string PostFollowCompanyUsingUrl(ref GlobusHttpHelper HttpHelper, Dictionary<string, Dictionary<string, string>> LinkdInContacts, int mindelay, int maxdelay)
        {
            string postdata = string.Empty;
             string postUrl = string.Empty;
             string ResLogin = string.Empty;
             string csrfToken = string.Empty;
             string sourceAlias = string.Empty;
             string ReturnString = string.Empty;

             try
             {
                 string MessageText = string.Empty;
                 string PostedMessage = string.Empty;
                 string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));

                 if (pageSource.Contains("csrfToken"))
                 {
                     csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 50);
                     string[] Arr = csrfToken.Split('&');
                     csrfToken = Arr[0];
                     csrfToken = csrfToken.Replace(":", "%3A").Replace("csrfToken", "").Replace("\"", string.Empty).Replace("value", string.Empty).Replace("cs", string.Empty).Replace("id", string.Empty).Replace("=", string.Empty);
                     csrfToken = csrfToken.Trim();
                 }

                 if (pageSource.Contains("sourceAlias"))
                 {
                     sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                     string[] Arr = sourceAlias.Split('"');
                     sourceAlias = Arr[2];
                 }

                 try
                 {
                     int counter = 0;
                     foreach (KeyValuePair<string, Dictionary<string, string>> UserValue in LinkdInContacts)
                     {
                         counter = counter + 1;
                         foreach (KeyValuePair<string, string> GroupValue in UserValue.Value)
                         {
                             post_url = string.Empty;
                             post_url = (GroupValue.Key + ":" + GroupValue.Value);

                             string Screen_name = UserValue.Key.Split(':')[0];
                             string pass = UserValue.Key.Split(':')[1];

                             postUrl = "https://www.linkedin.com/uas/login-submit";
                             postdata = "session_key=" + Screen_name + "&session_password=" + pass + "&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                             ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

                             try
                             {
                                 string GoBack = "%2Ebzo_*1_*1_*1_*1_*1_*1_*1_" + post_url.Split(':')[1];
                                 Log("[ " + DateTime.Now + " ] => [ ID: " + Screen_name + " has Follow the Company: " + post_url.Split(':')[0] + " ]");
                                 string pageGetreq = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/company/follow/submit?id=" + post_url.Split(':')[1] + "&fl=start&version=2&ft=pageKey%3Dbiz-overview-internal%3Bmodule%3Dbutton&sp=biz-overview&csrfToken=" + csrfToken + "&goback="+ GoBack));

                                 if (pageGetreq.Contains("Following"))
                                 {
                                     ReturnString = "Your request to Follow the: " + post_url.Split(':')[0] + " company has been Successfully Followed.";
                                     Log("[ " + DateTime.Now + " ] => [ " + ReturnString + " ]");
                                     //GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_FollowCompany);

                                 }
                                 else if (pageGetreq.Contains("Error"))
                                 {
                                     Log("[ " + DateTime.Now + " ] => [ Error In Follow Company ]");
                                     GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "Error In Follow Company", Globals.path_Not_FollowCompany);
                                 }
                                 else
                                 {
                                     Log("[ " + DateTime.Now + " ] => [ Company Could Not Be Followed ]");
                                     GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "Company Could Not Be Followed", Globals.path_Not_FollowCompany);
                                 }
                             }
                             catch { }

                             if (counter < LinkdInContacts.Count())
                             {
                                 int delay = RandomNumberGenerator.GenerateRandom(mindelay, maxdelay);
                                 Log("[ " + DateTime.Now + " ] => [ Delay for : " + delay + " Seconds ]");
                                 Thread.Sleep(delay * 1000);
                             }

                         }
                     }

                 }
                 catch (Exception ex)
                 {
                     GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Follow Company--1 --> PostFollowCompanyUsingUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                     GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Follow Company--1 --> PostFollowCompanyUsingUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinFollowCompanyErrorLogs);
                 }
             }
             catch (Exception ex)
             {
                 GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Follow Company--2--> PostFollowCompanyUsingUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
                 GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> Follow Company--2--> PostFollowCompanyUsingUrl() >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinFollowCompanyErrorLogs);
                 ReturnString = "Error";
             }
             return ReturnString;
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:100,代码来源:LinkedinCompanyFollow.cs

示例10: StartInBoardProGetDataWithPagination


//.........这里部分代码省略.........

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;

                if (pagenumber >= 1)
                {
                    _HttpHelper = HttpHelper;

                    if (!Globals.scrapeWithoutGoingToMainProfile)
                    {
                        new Thread(() =>
                        {
                            if (SearchCriteria.starter)
                            {
                                string CheckString = string.Empty;
                                finalUrlCollection(CheckString);
                            }

                        }).Start();
                    }

                    for (int i = 1; i <= pagenumber; i++)
                    {
                        if (SearchCriteria.starter)
                        {
                            #region loop

                            if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Basic"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "keywords=" + Uri.EscapeDataString(SearchCriteria.Keyword) + "&title=" + Uri.EscapeDataString(SearchCriteria.Title) + "&fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&f_FG=" + SearchCriteria.Group + "&companyScope=" + SearchCriteria.CompanyValue + "&countryCode=" + SearchCriteria.Country + "&company=" + SearchCriteria.Company + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    //Temporosy code for client
                                    //GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 3 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);

                                }
                                catch { }
                            }
                            else if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Executive"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "keywords=" + Uri.EscapeDataString(SearchCriteria.Keyword) + "&title=" + Uri.EscapeDataString(SearchCriteria.Title) + "&fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&f_FG=" + SearchCriteria.Group + "&companyScope=" + SearchCriteria.CompanyValue + "&countryCode=" + SearchCriteria.Country + "&keepFacets=keepFacets&I=" + SearchCriteria.IndustryType + "&SE=" + SearchCriteria.SeniorLevel + "&pplSearchOrigin=ADVS&viewCriteria=2&sortCriteria=R&facetsOrder=N%2CCC%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR%2CG&page_num=" + i + "&openFacets=N%2CCC%2CI";

                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                    //Temporosy code for client
                                    //GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 3 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);
                                }
                                catch { }
                            }
                            else if (ResponseWallPostForPremiumAcc.Contains("openAdvancedForm=true"))
                            {
                                PostRequestURL = "http://www.linkedin.com/vsearch/p?";
                                PostdataForPagination = "keywords=" + Uri.EscapeDataString(SearchCriteria.Keyword) + "&title=" + Uri.EscapeDataString(SearchCriteria.Title) + "&titleScope=" + SearchCriteria.TitleValue + "&firstName=" + SearchCriteria.FirstName + "&lastName=" + SearchCriteria.LastName + "&postalCode=" + SearchCriteria.PostalCode + "&openAdvancedForm=true&companyScope=" + SearchCriteria.CompanyValue + "&locationType=" + SearchCriteria.Location + "&f_FG=" + SearchCriteria.Group + "&countryCode=" + SearchCriteria.Country + "&company=" + SearchCriteria.Company + "&distance=" + SearchCriteria.within + "&f_N=" + SearchCriteria.Relationship + "&f_G=" + SearchCriteria.LocationArea + "&f_I=" + SearchCriteria.IndustryType + "&f_TE=" + SearchCriteria.YearOfExperience + "&f_FA=" + SearchCriteria.Function + "&f_SE=" + SearchCriteria.SeniorLevel + "&f_P=" + SearchCriteria.InerestedIn + "&f_CS=" + SearchCriteria.CompanySize + "&f_F=" + SearchCriteria.Fortune1000 + "&f_DR=" + SearchCriteria.RecentlyJoined + "&orig=ADVS&page_num=" + i + "";
                                PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                //Temporosy code for client
                                GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Pagesource 4 >>>> " + PostResponce, Globals.Path_InBoardProGetDataPagesource);
                            }
                            else
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:LinkedInScrape.cs

示例11: AddaPictureForEditMessage

       public bool AddaPictureForEditMessage(ref GlobusHttpHelper HttpHelper, string Username, string Password, string localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, string targeturl, string message, ref string status, string pageSource_Home, string xhpc_targetid, string xhpc_composerid, string message_text, string fb_dtsg, string UsreId, string pageSource, ref int tempCountMain,int delay)
       {

           // string pageSource = HttpHelper.getHtmlfromUrl(new Uri(targeturl));
           int tempCount = 0;
       startAgain:

           bool isSentPicMessage = false;
           //string fb_dtsg = string.Empty;
           string photo_id = string.Empty;
           //string UsreId = string.Empty;
           //xhpc_composerid = string.Empty;
           //xhpc_targetid = string.Empty;
           //message_text = string.Empty;

           try
           {
               #region commentedCode


               //string pageSource_Home = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/home.php"));

               //UsreId = GlobusHttpHelper.GetParamValue(pageSource_Home, "user");
               //if (string.IsNullOrEmpty(UsreId))
               //{
               //    UsreId = GlobusHttpHelper.ParseJson(pageSource_Home, "user");
               //}

               //fb_dtsg = GlobusHttpHelper.GetParamValue(pageSource_Home, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
               //if (string.IsNullOrEmpty(fb_dtsg))
               //{
               //    fb_dtsg = GlobusHttpHelper.ParseJson(pageSource_Home, "fb_dtsg");
               //}


               //string pageSource_HomeData = HttpHelper.getHtmlfromUrl(new Uri(targeturl));
               //xhpc_composerid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "composerid");
               //xhpc_targetid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "xhpc_targetid"); 
               #endregion

               string composer_session_id = "";

               string tempresponse1 = "";
               ///temp post
               {
                   string source = "";
                   string profile_id = "";
                   string gridID = "";
                   //  string qn = string.Empty;

                   try
                   {
                       string Url = "https://www.facebook.com/ajax/composerx/attachment/media/upload/?composerurihash=1";
                       string posturl1 = "fb_dtsg=" + fb_dtsg + "&composerid=" + xhpc_composerid + "&targetid=" + xhpc_targetid + "&loaded_components[0]=maininput&loaded_components[1]=cameraicon&loaded_components[2]=withtaggericon&loaded_components[3]=placetaggericon&loaded_components[4]=mainprivacywidget&loaded_components[5]=cameraicon&loaded_components[6]=mainprivacywidget&loaded_components[7]=withtaggericon&loaded_components[8]=placetaggericon&loaded_components[9]=maininput&nctr[_mod]=pagelet_group_composer&__user=" + UsreId + "&__a=1&__dyn=7n88QoAMNoBwXAw&__req=i&phstamp=16581688688747595501";    //"fb_dtsg=" + fb_dtsg + "&composerid=" + xhpc_composerid + "&targetid=" + xhpc_targetid + "&istimeline=1&timelinelocation=composer&loaded_components[0]=maininput&loaded_components[1]=mainprivacywidget&loaded_components[2]=mainprivacywidget&loaded_components[3]=maininput&loaded_components[4]=explicitplaceinput&loaded_components[5]=hiddenplaceinput&loaded_components[6]=placenameinput&loaded_components[7]=hiddensessionid&loaded_components[8]=withtagger&loaded_components[9]=backdatepicker&loaded_components[10]=placetagger&loaded_components[11]=withtaggericon&loaded_components[12]=backdateicon&loaded_components[13]=citysharericon&nctr[_mod]=pagelet_timeline_recent&__user=" + UsreId + "&__a=1&__dyn=7n88QoAMNoBwXAw&__req=18&phstamp=1658168111112559866679";
                       // string PostUrl = "city_id=" + CityIDS1 + "&city_page_id=" + city_page_id + "&city_name=" + CityName1 + "&is_default=false&session_id=1362404125&__user=" + UsreId + "&__a=1&__dyn=798aD5z5ynU&__req=z&fb_dtsg=" + fb_dtsg + "&phstamp=1658168111112559866165";
                       string res11 = HttpHelper.postFormData(new Uri(Url), posturl1);


                       try
                       {
                           source = res11.Substring(res11.IndexOf("source\":"), (res11.IndexOf(",", res11.IndexOf("source\":")) - res11.IndexOf("source\":"))).Replace("source\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();

                       }
                       catch (Exception ex)
                       {
                           GlobusLogHelper.log.Error(ex.StackTrace);
                       }
                       if (string.IsNullOrEmpty(source))
                       {
                           source = Utils.getBetween(res11, "source", "profile_id").Replace("\\\"", "").Replace(",", "").Replace(":", "").Trim();

                       }
                       try
                       {
                           profile_id = res11.Substring(res11.IndexOf("profile_id\":"), (res11.IndexOf("}", res11.IndexOf("profile_id\":")) - res11.IndexOf("profile_id\":"))).Replace("profile_id\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                           if (profile_id.Contains(","))
                           {
                               profile_id = ParseEncodedJson(res11, "profile_id");
                           }
                           //"gridID":
                       }
                       catch { }
                       if (string.IsNullOrEmpty(profile_id))
                       {
                           profile_id = Utils.getBetween(res11, "profile_id", "}").Replace("\\\"", "").Replace(",", "").Replace(":", "").Trim();
                       }
                       try
                       {
                           gridID = res11.Substring(res11.IndexOf("gridID\":"), (res11.IndexOf(",", res11.IndexOf("gridID\":")) - res11.IndexOf("gridID\":"))).Replace("gridID\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                       }
                       catch (Exception ex)
                       {
                           GlobusLogHelper.log.Error(ex.StackTrace);
                       }
                       if (string.IsNullOrEmpty(gridID))
                       {
                           gridID = Utils.getBetween(res11, "gridID", ",").Replace("\\\"", "").Replace(",", "").Replace(":", "").Trim(); ;
                       }


//.........这里部分代码省略.........
开发者ID:shah8701,项目名称:faceboard,代码行数:101,代码来源:BoardProHttpHelper.cs

示例12: LogoutHttpHelper

        public bool LogoutHttpHelper(ref GlobusHttpHelper HttpHelper)
        {
            try
            {
                //string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/"));
                string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/"));
                if (pageSource1.Contains("\"h\"") && pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                {
                    string h = string.Empty;
                    string post_form_id = string.Empty;
                    string fb_dtsg = string.Empty;

                    if (pageSource1.Contains("\"h\""))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("\"h\""), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        h = ArrTemp[3];
                    }
                    if (pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("post_form_id"), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        post_form_id = ArrTemp[2];
                        fb_dtsg = ArrTemp[6];

                    }

                    string ResponseLogout = HttpHelper.postFormData(new Uri("http://www.facebook.com/logout.php"), "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&ref=mb&h=" + h);
                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                return false;
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:38,代码来源:LogOutAccount.cs

示例13: SearchByPeople


//.........这里部分代码省略.........
                try
                {
                    strPageNumber = strPageNumber.Replace(".", string.Empty);
                    if (strPageNumber != string.Empty || strPageNumber == "0")
                    {
                        Log("[ " + DateTime.Now + " ] => [ Total Results found: " + strPageNumber + " ]");
                    }
                    pagenumber = int.Parse(strPageNumber);
                }
                catch (Exception)
                {

                }
                pagenumber = (pagenumber / 10) + 1;

                string GetResponce = string.Empty;
                string GetRequestURL = string.Empty;

                if (pagenumber >= 1)
                {
                    for (int i = 1; i <= pagenumber; i++)
                    {
                        //if (SearchCriteria.starter)
                        {

                            #region loop

                            if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Basic"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "keywords=" + _Keyword + "&searchLocationType=Y&search=&pplSearchOrigin=GLHD&viewCriteria=2&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=CC%2CN%2CG";//"fname=" + SearchCriteria.FirstName + "&lname=" + SearchCriteria.LastName + "&searchLocationType=" + SearchCriteria.Location + "&countryCode=" + SearchCriteria.Country + "&viewCriteria=1&sortCriteria=R&facetsOrder=CC%2CN%2CG%2CI%2CPC%2CED%2CL%2CFG%2CTE%2CFA%2CSE%2CP%2CCS%2CF%2CDR&page_num=" + i + "&openFacets=N%2CCC%2CG";
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }
                            }
                            else if (ResponseWallPostForPremiumAcc.Contains("Account: Basic") || ResponseWallPostForPremiumAcc.Contains("Cuenta: Básica"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/fpsearch?";
                                    PostdataForPagination = "type=people&keywords="+_Keyword+"&page_num="+i;
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL),PostdataForPagination);
                                }
                                catch { }

                            }

                            else if (ResponseWallPostForPremiumAcc.Contains("Account Type:</span> Executive"))
                            {
                                try
                                {
                                    PostRequestURL = "http://www.linkedin.com/search/hits";
                                    PostdataForPagination = "type=people&keywords=" + _Keyword + "&page_num=" + i;
                                    PostResponce = HttpHelper.postFormData(new Uri(PostRequestURL), PostdataForPagination);
                                }
                                catch { }

                            }
                            else
                            {
                                try
                                {

                                    PostRequestURL = "http://www.linkedin.com/search/fpsearch?";
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:LinkedinSearch.cs

示例14: SendInvitation


//.........这里部分代码省略.........

                        string FName = string.Empty;
                        string Lname = string.Empty;

                        FName = itemChecked.Value.Split(' ')[0];
                        Lname = itemChecked.Value.Split(' ')[1];

                        FullName = FName + " " + Lname;
                        try
                        {
                            ContactName = ContactName + "  :  " + FullName;
                        }
                        catch { }
                        if (ToMsg == string.Empty)
                        {
                            ToMsg += FullName;
                        }
                        else
                        {
                            ToMsg += ";" + FullName;
                        }

                        Log("[ " + DateTime.Now + " ] => [ Adding Contact : " + FullName + " ]");

                        string ToCd = itemChecked.Key;

                        if (ToCd.Contains(":"))
                        {
                            try
                            {
                                ToCd = ToCd.Substring(ToCd.IndexOf(":"), ToCd.Length - ToCd.IndexOf(":")).Replace(":", string.Empty).Trim();
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine("Error >>> " + ex.StackTrace);
                            }

                        }

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

                        if (FString == string.Empty)
                        {
                            string CompString = "{" + "\"" + "_" + ToCd.Trim() + "\"" + ":" + "{" + "\"" + "memberId" + "\"" + ":" + "\"" + ToCd.Trim() + "\"" + "," + "\"" + "firstName" + "\"" + ":" + "\"" + FName + "\"" + "," + "\"" + "lastName" + "\"" + ":" + "\"" + Lname + "\"" + "}";
                            FString = CompString;
                        }
                        else
                        {
                            string CompString = "\"" + "_" + ToCd.Trim() + "\"" + ":" + "{" + "\"" + "memberId" + "\"" + ":" + "\"" + ToCd.Trim() + "\"" + "," + "\"" + "firstName" + "\"" + ":" + "\"" + FName + "\"" + "," + "\"" + "lastName" + "\"" + ":" + "\"" + Lname + "\"" + "}";
                            FString = CompString;
                        }

                        if (Nstring == string.Empty)
                        {
                            Nstring = FString;
                            connId = ToCd;
                        }
                        else
                        {
                            Nstring += "," + FString;
                            connId += " " + ToCd;
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("ex.Message >>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace + "  ex.Stack Trace >>> " + ex.StackTrace);
                    }

                    //}
                    Nstring += "}";

                    string postData = "csrfToken=" + csrfToken + "&emailRecipients=&subAddMbrs=Send+Invitations&gid=" + grpId + "&invtActn=im-invite&cntactSrc=cs-connections&remIntives=999&connectionIds=" + connId + "&connectionNames=" + Uri.EscapeUriString(Nstring) + "&contactIDs=&newGroup=false";

                    string response = HttpHelper.postFormData(new Uri("http://www.linkedin.com/manageGroup"), postData);

                    //if (response.Contains("You have successfully sent invitations to this group") || response.Contains("Upgrade Your Account"))
                        if (response.Contains("You have successfully sent invitations to this group"))
                    {
                        Log("[ " + DateTime.Now + " ] => [ You have successfully sent invitations to Group : " + grpURL + " With Username : " + accountUser + "Invite user : " + FullName + " ]");
                        string CSVHeader = "GroupUrl" + "," + "UserName" + "," + "Invite User" ;
                        string CSVContent = grpURL + "," + accountUser + "," + FullName;
                        CSVUtilities.ExportDataCSVFile(CSVHeader, CSVContent, Globals.path_SentInvitationGroup);
                       // GlobusFileHelper.AppendStringToTextfileNewLine(content, Globals.path_SentInvitationGroup);

                    }
                    else
                    {
                        Log("[ " + DateTime.Now + " ] => [ Couldn't Send Invitation With Username : " + accountUser + " ]");
                        string CSVHeader = "GroupUrl" + "," + "UserName";
                        string CSVContent = grpURL + "," + accountUser;
                        CSVUtilities.ExportDataCSVFile(CSVHeader, CSVContent, Globals.path_NotSentInvitationGroup);
                        //GlobusFileHelper.AppendStringToTextfileNewLine(content, Globals.path_NotSentInvitationGroup);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error >>> " + ex.StackTrace);
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:CreateGroup.cs

示例15: PostSearchGroupAddFinal

        public string PostSearchGroupAddFinal(ref GlobusHttpHelper HttpHelper, string Screen_name, string pass, List<string> SelectedItem, int mindelay, int maxdelay)
        {
            string postdata = string.Empty;
             string postUrl = string.Empty;
             string ResLogin = string.Empty;
             string csrfToken = string.Empty;
             string sourceAlias = string.Empty;
             string ReturnString = string.Empty;
             string GroupName = string.Empty;

             try
             {
                 string MessageText = string.Empty;
                 string PostedMessage = string.Empty;

                 string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));
                 if (pageSource.Contains("csrfToken"))
                 {
                     csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 50);
                     string[] Arr = csrfToken.Split('&');
                     csrfToken = Arr[0];
                     csrfToken = csrfToken.Replace(":", "%3A").Replace("csrfToken", "").Replace("\"", string.Empty).Replace("value", string.Empty).Replace("cs", string.Empty).Replace("id", string.Empty).Replace("=",string.Empty).Replace(">",string.Empty).Replace("\n", string.Empty).Replace("<script src",string.Empty).Replace("<meta http-",string.Empty);
                     csrfToken = csrfToken.Trim();
                 }

                 if (pageSource.Contains("sourceAlias"))
                 {
                     sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                     string[] Arr = sourceAlias.Split('"');
                     sourceAlias = Arr[2];
                 }

                 postUrl = "https://www.linkedin.com/uas/login-submit";
                 postdata = "session_key=" + Screen_name + "&session_password=" + pass + "&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                 ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);

                 try
                 {
                     foreach (string Itemgid in SelectedItem)
                     {
                         try
                         {
                             string GoBack = "/%2Eanb_" + Itemgid.Split(':')[1];
                             Log("[ " + DateTime.Now + " ] => [ Joining Group: " + Itemgid.Split(':')[0] + " ]");
                             string pageGetreq = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/groupRegistration?gid=" + Itemgid.Split(':')[1] + "&csrfToken=" + csrfToken + "&trk=group-join-button"));

                             Thread.Sleep(2000);

                             if (pageGetreq.Contains("Your request to join the"))
                             {
                                 ReturnString = "Your request to join the: " + Itemgid.Split(':')[0] + " group has been received.";
                                 Log("[ " + DateTime.Now + " ] => [ " + ReturnString + " ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_JoinSearchGroupSuccess);
                             }
                             else if (pageGetreq.Contains("Welcome to the"))
                             {
                                 ReturnString = "Welcome to the: " + Itemgid.Split(':')[0] + " group on LinkedIn.";
                                 Log("[ " + DateTime.Now + " ] => [ " + ReturnString + " ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_JoinSearchGroupSuccess);
                             }
                             else if (pageGetreq.Contains("You're already a member of the"))
                             {
                                 ReturnString = "[ " + DateTime.Now + " ] => [ You're already a member of the: " + Itemgid.Split(':')[0] + " ]";
                                 Log("" + ReturnString + "");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_JoinSearchGroupSuccess);
                             }
                             else if (pageGetreq.Contains("Your settings have been updated"))
                             {
                                 ReturnString = "Your request to join the: " + Itemgid.Split(':')[0] + " group has been received.";
                                 Log("[ " + DateTime.Now + " ] => [ " + ReturnString + " ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_JoinSearchGroupSuccess);
                             }
                             else if (pageGetreq.Contains("We’re sorry, this group has reached its maximum number of members allowed. If you have any questions, please contact the group manager for more information"))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ We’re sorry, this group has reached its maximum number of members allowed. ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "We’re sorry, this group has reached its maximum number of members allowed.", Globals.path_JoinSearchGroupFail);
                             }
                             else if (pageGetreq.Contains("reached or exceeded the maximum number of pending group applications."))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ We’re sorry...You’ve reached or exceeded the maximum number of pending group applications. Please wait for your pending requests to be approved by a group manager or withdraw pending requests before joining new groups. ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "We’re sorry...You’ve reached or exceeded the maximum number of pending group applications. Please wait for your pending requests to be approved by a group manager or withdraw pending requests before joining new groups. ", Globals.path_JoinSearchGroupFail);
                                 break;
                             }
                             else if (pageGetreq.Contains("reached or exceeded the maximum number of confirmed and pending groups."))
                             {
                                 ReturnString = "You’ve reached or exceeded the maximum number of confirmed and pending groups.";
                                 Log("[ " + DateTime.Now + " ] => [ You’ve reached or exceeded the maximum number of confirmed and pending groups. ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + ReturnString, Globals.path_JoinSearchGroupFail);
                                 break;
                             }
                             else if (pageGetreq.Contains("Error"))
                             {
                                 Log("[ " + DateTime.Now + " ] => [ Error In Joining Group ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "Error In Joining Group", Globals.path_JoinSearchGroupFail);
                             }
                             else
                             {
                                 Log("[ " + DateTime.Now + " ] => [ Group Could Not Be Joined ]");
                                 GlobusFileHelper.AppendStringToTextfileNewLine(Screen_name + ":" + "Group Could Not Be Joined", Globals.path_JoinSearchGroupFail);
                             }
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:JoinSearchGroup.cs


注:本文中的BaseLib.GlobusHttpHelper.postFormData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。