예제 #1
0
        public void PostOnFanPageCommentWithURLAndItsImage(ref FacebookUser fbUser)
        {
            string Username = fbUser.username;
            string Password = fbUser.password;
            try
            {              

                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;                


                GlobusLogHelper.log.Info("Please Wait....");
                GlobusLogHelper.log.Debug("Please Wait...");

                lstFanPageURLs = lstFanPageURLs.Distinct().ToList();

               List<string> lstPostMsg = lstMessageCollectionCommentLiker.Distinct().ToList();

               string user = "";
               string fdUserDesignation = "";
               string feedbackParams = "";
               #region MyRegion
               string timelineUfi = "";
               string timelineLogData = "";
               string translate_on_load = "";
               string add_comment_text_text = "";
               string add_comment_text = "";
               string comment_replace = "";
               string comment = "1";
               string __a = "1";
               string UsreId = "";
               string charset_test = ""; 
               #endregion
               string post_form_id = string.Empty;
               string phstamp = Utils.GenerateTimeStamp();


               int postsCount = 0;
 
                foreach (string pageUrl in lstFanPageUrlCollectionCommentLiker )
                {
                  
                        try
                        {
                            int CountPostWall = 1;
                            string FanpageUrl = pageUrl;


                            if (FanpageUrl.Contains("?sk=wall"))
                            {
                                try
                                {
                                    FanpageUrl = FanpageUrl.Remove(FanpageUrl.IndexOf("?sk=wall"));
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            FanpageUrl = FanpageUrl + "?sk=wall";

                            string wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
                            if (string.IsNullOrEmpty(wallPageSrc))
                            {
                                wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
                                if (string.IsNullOrEmpty(wallPageSrc))
                                {
                                    FanpageUrl = FanpageUrl.Replace("?sk=wall", "");
                                    wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));
                                }
                            }

                            if (string.IsNullOrEmpty(wallPageSrc))
                            {
                                GlobusLogHelper.log.Debug("The page could not be found :- " + pageUrl);
                                GlobusLogHelper.log.Info("The page could not be found :- " + pageUrl);
                                continue;
                            }


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

                            //    To Find all post data of a page

                            //******************************************************************
                            string[] Arraggregation_id = Regex.Split(wallPageSrc, "aggregation_id");

                            foreach (string itemFan in Arraggregation_id)
                            {
                                try
                                {
                                    if (!itemFan.Contains("<!DOCTYPE"))
                                    {
                                        if (itemFan.Contains("/form") || itemFan.Contains("aggregation_id"))
                                        {
                                            string tempFan = itemFan;

                                            FanpgeData.Add(tempFan);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }


                            // ****************************************************************** 

                            string[] ArrFrom = Regex.Split(wallPageSrc, "uiUnifiedStory uiStreamStory genericStreamStory aid");


                            foreach (string itemFan in ArrFrom)
                            {
                                try
                                {
                                    if (!itemFan.Contains("<!DOCTYPE"))
                                    {
                                        if (itemFan.Contains("/form"))
                                        {
                                            try
                                            {
                                                string tempFan = itemFan;
                                                tempFan = tempFan.Substring(0, tempFan.IndexOf("/form"));
                                                FanpgeData.Add(tempFan);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            if (ArrFrom.Length == 1)
                            {
                                try
                                {

                                    ArrFrom = Regex.Split(wallPageSrc, "<li ");
                                    foreach (string itemFan in ArrFrom)
                                    {
                                        if (!itemFan.Contains("<!DOCTYPE"))
                                        {
                                            try
                                            {

                                                if (itemFan.Contains("fbTimelineUnit fbTimelineTwoColumn clearfix") || itemFan.Contains("fbTimelineUnit lastCapsule fbTimelineTwoColumn clearfix")
                                                    || itemFan.Contains("fbTimelineUnit firstUnit fbTimelineTwoColumn clearfix") || itemFan.Contains("fbTimelineUnit firstUnit lastCapsule fbTimelineTwoColumn clearfix")
                                                    || itemFan.Contains("fbTimelineUnit lastCapsule fbTimelineTwoColumn clearfix"))
                                                {

                                                    FanpgeData.Add(itemFan);
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            user = GlobusHttpHelper.Get_UserID(wallPageSrc);



                            if (wallPageSrc.Contains("post_form_id"))
                            {
                                post_form_id = GlobusHttpHelper.GetParamValue(wallPageSrc, "post_form_id");
                            }

                            //if (FanpgeData.Count < intNoOfPost)
                            {
                                try
                                {
                                    //find otherpost from JavaScript

                                    string profileId = string.Empty;
                                    string End = string.Empty;
                                    string AjaxPip_token = string.Empty;
                                    string OtherData = string.Empty;

                                    //Break string from profile id where we find page posts.
                                    try
                                    {
                                        OtherData = System.Text.RegularExpressions.Regex.Split(wallPageSrc, "{\"profile_id\":")[1];
                                    }
                                    catch (Exception ex)
                                    {
                                        //  OtherData = System.Text.RegularExpressions.Regex.Split(wallPageSrc, "profile_id")[1];
                                    }

                                    try
                                    {
                                        //get profile Id 
                                        profileId = OtherData.Substring(0, OtherData.IndexOf("start")).Replace(",\"", string.Empty);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }

                                    try
                                    {
                                        //get end of search query 
                                        End = OtherData.Substring(OtherData.IndexOf("end"), OtherData.IndexOf("query_type") - OtherData.IndexOf("end")).Replace(",\"", string.Empty).Replace("end\":", string.Empty);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }

                                    try
                                    {
                                        //get ajax pip token key
                                        AjaxPip_token = System.Text.RegularExpressions.Regex.Split(wallPageSrc, "ajaxpipe_token\":")[1];
                                        AjaxPip_token = AjaxPip_token.Substring(0, AjaxPip_token.IndexOf("\",\"")).Replace("\"", string.Empty);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }

                                    //Face book script Url Where we find Data 

                                    string ScripUrl = FBGlobals.Instance.CommentLikerPostajaxGenricUrl + AjaxPip_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + profileId + "%2C%22start%22%3A0%2C%22end%22%3A" + End + "%2C%22query_type%22%3A36%2C%22sk%22%3A%22wall%22%2C%22page_index%22%3A1%2C%22section_container_id%22%3A%22u_0_13%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_12%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22time_cutoff%22%3Anull%2C%22buffer%22%3A50%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Atrue%2C%22num_visible_units%22%3A6%2C%22remove_dupes%22%3Atrue%2C%22pager_fired_on_init%22%3Atrue%7D&__user="******"&__a=1&__dyn=798aD5z5ynU&__req=jsonp_2&__adt=2";

                                    string html = HttpHelper.getHtmlfromUrl(new Uri(ScripUrl));

                                    //break string from fbtimeline ....
                                    string[] FbTimelineUnit = System.Text.RegularExpressions.Regex.Split(html, "fbTimelineUnit");

                                    //FanpgeData.Clear();

                                    //Skip Ist index of string ..
                                    List<string> FbTimelineUnit1 = new List<string>(FbTimelineUnit);
                                    try
                                    {
                                        FbTimelineUnit1.Remove(FbTimelineUnit1[0]);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }

                                    //shorting and store in FanpgeData List of page Posts
                                    foreach (string FbTimelineUnit_item in FbTimelineUnit1)
                                    {
                                        try
                                        {
                                            if (FbTimelineUnit_item.Contains("fbTimelineTwoColumn clearfix") || FbTimelineUnit_item.Contains("lastCapsule fbTimelineTwoColumn clearfix")
                                                                                || FbTimelineUnit_item.Contains("firstUnit fbTimelineTwoColumn clearfix") || FbTimelineUnit_item.Contains("firstUnit lastCapsule fbTimelineTwoColumn clearfix")
                                                                                || FbTimelineUnit_item.Contains("lastCapsule fbTimelineTwoColumn clearfix"))
                                            {
                                                FanpgeData.Add(FbTimelineUnit_item);
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }


                            // For targeted 

                            if (!IsCommentLikerPostTargeted)
                            {
                                FanpgeData.Clear();
                                FanpgeData.Add(wallPageSrc);
                            }

                            int tempCounter_LikeSelected = 0;
                            foreach (string item in FanpgeData)
                            {
                                try
                                {
                                    string ftentidentifier = string.Empty;

                                    string postResponse = string.Empty;
                                    string link_data = string.Empty;


                                    add_comment_text_text = Uri.EscapeDataString(lstMessageCollectionCommentLiker[new Random().Next(0, lstMessageCollectionCommentLiker.Count)]);
                                    add_comment_text = add_comment_text_text;
                                    if (item.Contains("data-ft="))
                                    {
                                        try
                                        {
                                            int startIndx = item.IndexOf("data-ft=");
                                            int endIndx = item.IndexOf("&#125;", startIndx);

                                            link_data = item.Substring(startIndx, endIndx - startIndx).Replace("&quot;", "\"").Replace("data-ft=\\\"&#123;\"", string.Empty);
                                            link_data = "{" + link_data + "}";
                                            link_data = Uri.EscapeDataString(link_data);
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }


                                    //string modifiedItem = "name=\"feedback_params" + item;
                                    feedbackParams = string.Empty;
                                    feedbackParams = GlobusHttpHelper.GetParamValue(item, "feedback_params");
                                    if (!string.IsNullOrEmpty(feedbackParams))
                                    {
                                        feedbackParams = GlobusHttpHelper.GetParamValue(item, "feedback_params").Replace("&quot;", "\"");
                                        feedbackParams = feedbackParams.Replace("&#123;", "");
                                        feedbackParams = feedbackParams.Replace("&#125;", "");
                                        feedbackParams = "{" + feedbackParams + "}";
                                        feedbackParams = Uri.EscapeDataString(feedbackParams);
                                    }

                                    timelineLogData = string.Empty;
                                    timelineLogData = GlobusHttpHelper.GetParamValue(item, "timeline_log_data");
                                    if (!string.IsNullOrEmpty(feedbackParams))
                                    {
                                        try
                                        {
                                            timelineLogData = GlobusHttpHelper.GetParamValue(item, "timeline_log_data").Replace("&quot;", "\"");
                                            timelineLogData = timelineLogData.Replace("&#123;", "");
                                            timelineLogData = timelineLogData.Replace("&#125;", "");
                                            //timeline_log_data = "{" + timeline_log_data + "}";
                                            timelineLogData = timelineLogData;

                                            timelineLogData = Uri.EscapeDataString(timelineLogData);
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }

                                    if (string.IsNullOrEmpty(timelineLogData))
                                    {
                                        //  continue;
                                    }



                                    fdUserDesignation = GlobusHttpHelper.Get_fb_dtsg(wallPageSrc);

                                    //Get Values Of identitifire
                                    #region Get Value Of identitifire

                                    try
                                    {
                                        //By Ajay Due to Post data change...
                                        if (item.Contains("ftentidentifier"))
                                        {
                                            try
                                            {
                                                string[] arrftentidentifier = Regex.Split(item, "ftentidentifier");
                                                if (arrftentidentifier.Count() > 1)
                                                {
                                                    if (arrftentidentifier[1].Contains(":"))
                                                    {
                                                        ftentidentifier = arrftentidentifier[1].Substring(arrftentidentifier[1].IndexOf(":"), (arrftentidentifier[1].IndexOf(",", arrftentidentifier[1].IndexOf(":")) - arrftentidentifier[1].IndexOf(":"))).Replace(":", string.Empty).Replace("\"", string.Empty).Trim();
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                        else if (item.Contains("identifier"))
                                        {
                                            try
                                            {
                                                string[] arrftentidentifier = Regex.Split(item, "identifier");
                                                if (arrftentidentifier.Count() > 1)
                                                {
                                                    if (arrftentidentifier[1].Contains("="))
                                                    {
                                                        try
                                                        {
                                                            ftentidentifier = arrftentidentifier[1].Substring(arrftentidentifier[1].IndexOf("="), (arrftentidentifier[1].IndexOf("&amp;") - arrftentidentifier[1].IndexOf("="))).Replace(":", string.Empty).Replace("\"", string.Empty).Replace("=", string.Empty).Trim();
                                                        }
                                                        catch (Exception ex)
                                                        {
                                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                        }
                                                    }
                                                    else if (arrftentidentifier[1].Contains(":"))
                                                    {
                                                        try
                                                        {
                                                            ftentidentifier = arrftentidentifier[1].Substring(arrftentidentifier[1].IndexOf(":"), (arrftentidentifier[1].IndexOf(",", arrftentidentifier[1].IndexOf(":")) - arrftentidentifier[1].IndexOf(":"))).Replace(":", string.Empty).Replace("\"", string.Empty).Trim();
                                                        }
                                                        catch (Exception ex)
                                                        {
                                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                        }
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                        else if (item.Contains("target_fbid"))
                                        {
                                            string[] arrftentidentifier = Regex.Split(item, "target_fbid");
                                            try
                                            {
                                                if (arrftentidentifier.Count() > 1)
                                                {
                                                    if (arrftentidentifier[1].Contains("="))
                                                    {
                                                        string datastr = arrftentidentifier[arrftentidentifier.Count() - 1];
                                                        ftentidentifier = System.Text.RegularExpressions.Regex.Split(datastr.Substring(datastr.IndexOf("="), (datastr.IndexOf("><i>") - datastr.IndexOf("="))), " rel")[0].Replace("=", string.Empty).Replace("\"", string.Empty).Trim();
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                            if (string.IsNullOrEmpty(ftentidentifier))
                                            {
                                                try
                                                {
                                                    if (arrftentidentifier.Count() > 1)
                                                    {
                                                        if (arrftentidentifier[1].Contains("="))
                                                        {
                                                            string datastr = arrftentidentifier[arrftentidentifier.Count() - 1];
                                                            ftentidentifier = System.Text.RegularExpressions.Regex.Split(datastr.Substring(datastr.IndexOf("="), (datastr.IndexOf("\"") - datastr.IndexOf("=") - 1)), "rel")[0].Replace("=", string.Empty).Replace("\"", string.Empty).Trim();
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }

                                            if (string.IsNullOrEmpty(ftentidentifier))
                                            {
                                                try
                                                {
                                                    if (arrftentidentifier.Count() > 1)
                                                    {
                                                        if (arrftentidentifier[1].Contains("target_profile_id"))
                                                        {
                                                            string datastr = arrftentidentifier[arrftentidentifier.Count() - 1];

                                                            ftentidentifier = (datastr.Substring(0, (datastr.IndexOf("target_profile_id")))).Replace(",", string.Empty).Replace("&quot;", string.Empty).Replace(":", string.Empty).Replace("target_profile_id", string.Empty).Replace("=", string.Empty).Replace("\"", string.Empty).Trim();

                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }

                                            if (string.IsNullOrEmpty(ftentidentifier))
                                            {
                                                try
                                                {
                                                    if (item.Contains("aggregation_id"))
                                                    {
                                                        ftentidentifier = item.Substring(0, item.IndexOf(",")).Replace(",", string.Empty).Replace("&quot;", string.Empty).Replace(":", string.Empty).Replace("aggregation_id", string.Empty).Replace("=", string.Empty).Replace("\"", string.Empty).Trim(); ;

                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }
                                        }
                                        else if (item.Contains("aggregation_id") && item.Contains("aggregation_time"))
                                        {
                                            string identitifier = item.Substring(item.IndexOf("aggregation_id"), item.IndexOf("aggregation_time") - item.IndexOf("aggregation_id")).Replace("&quot;", string.Empty).Replace(",", string.Empty).Replace("aggregation_id", string.Empty).Replace("aggregation_time", string.Empty).Replace(":", string.Empty).Trim();
                                            ftentidentifier = identitifier;
                                        }

                                        if (string.IsNullOrEmpty(ftentidentifier) && wallPageSrc.Contains("target_profile_id"))
                                        {
                                            try
                                            {
                                                ftentidentifier = (wallPageSrc.Substring(wallPageSrc.IndexOf("target_profile_id"), (wallPageSrc.IndexOf(",", wallPageSrc.IndexOf("target_profile_id")) - wallPageSrc.IndexOf("target_profile_id")))).Replace(",", string.Empty).Replace("&quot;", string.Empty).Replace(":", string.Empty).Replace("target_profile_id", string.Empty).Replace("=", string.Empty).Replace("\"", string.Empty).Trim();
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }

                                    #endregion

                                    try
                                    {
                                        // Post Like 
                                        string postData1 = "__user="******"&__a=1&fb_dtsg=" + fdUserDesignation + "&phstamp=165816798981224510745"; //__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=165816798981224510745
                                        string postResponse1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.CommentLikerPostAjaxFacbookLikeCommentUrl + ftentidentifier + "&comment_from=" + user + "&seen_user_fbids=true"), postData1);

                                        string postData2 = "like_action=true&ft_ent_identifier=" + ftentidentifier + "&source=0&&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&fb_dtsg=" + fdUserDesignation + "&phstamp=1658167989812245107166";//like_action=true&ft_ent_identifier=348874178538877&source=0&client_id=1347961309895%3A42929564&ft[tn]=%3E%3D&ft[type]=20&__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=1658167989812245107166
                                        string postResponse2 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.CommentLikerPostAjaxFacbookLikeUrl), postData2);
                                        //-------------------------------
                                        string postData = "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&post_form_id=" + post_form_id + "&fb_dtsg=" + fdUserDesignation + "&feedback_params=" + feedbackParams + "&timeline_ufi=1&timeline_log_data=" + timelineLogData + "&translate_on_load=&add_comment_text=&like=&nctr[_mod]=pagelet_timeline_recent&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=16581651065011769561080";
                                        postResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.CommentLikerPostAjaxFacbookModifyUrl), postData);

                                        if (postResponse.Contains("Security Check Required"))
                                        {
                                            //IsLoginError = true;
                                            string content = Username + ":" + Password;
                                            GlobusLogHelper.log.Info("Security Check Required " + FanpageUrl + "  with " + Username);
                                            GlobusLogHelper.log.Debug("Security Check Required " + FanpageUrl + "  with " + Username);

                                        }

                                        if (!postResponse.Contains("Security Check Required"))// && !postResponse.Contains("errorSummary")
                                        {
                                            string CSVHeader = "UserName" + "," + "FanpageUrl";
                                            string CSV_Content = Username + "," + FanpageUrl;
                                            // TotalFanPagelike_Counter++;
                                            GlobusLogHelper.log.Info(" Like Comment with " + Username + " on Wall : " + FanpageUrl);
                                            GlobusLogHelper.log.Debug(" Like Comment with " + Username + " on Wall : " + FanpageUrl);
                                            //   CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LikedComments);


                                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                                    }


                                    string postcommnetPageData = "ft_ent_identifier=" + ftentidentifier.Replace("}", "") + "&comment_text=" + add_comment_text_text + "&source=0&client_id=1364464472423%3A4032021415&reply_fbid&parent_comment_id&timeline_log_data=" + timelineLogData + "&rootid=u_0_2l&attached_photo_fbid=0&ft[tn]=[]&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=798aD5z5ynU&__req=a&fb_dtsg=" + fdUserDesignation + "&phstamp=16581679711910210969710";
                                    string commentResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.CommentLikerPostAjaxFacbookAddCommentUrl), postcommnetPageData);

                                    if (wallPageSrc.Contains("setAdsTracking"))
                                    {
                                        try
                                        {
                                            string setAdsTracking = wallPageSrc.Substring(wallPageSrc.IndexOf("setAdsTracking"), (wallPageSrc.IndexOf("}]]]}", wallPageSrc.IndexOf("setAdsTracking")) - wallPageSrc.IndexOf("setAdsTracking"))).Replace("setAdsTracking", string.Empty).Trim();
                                            string[] arrsetAdsTracking = Regex.Split(setAdsTracking, ":");
                                            foreach (string item1 in arrsetAdsTracking)
                                            {
                                                try
                                                {
                                                    if (item1.Length > 30)
                                                    {
                                                        try
                                                        {
                                                            string partRequest = string.Empty;
                                                            if (item1.Contains(","))
                                                            {
                                                                partRequest = item1.Substring(0, item1.IndexOf(",")).Replace("\"", string.Empty).Trim();
                                                            }
                                                            else
                                                            {
                                                                partRequest = item1.Replace("\"", string.Empty).Trim();
                                                            }
                                                            string response = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.CommentLikerGetFbAIUrl + partRequest));
                                                        }
                                                        catch (Exception ex)
                                                        {
                                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }

                                    if (commentResponse.Contains("errorSummary") && commentResponse.Contains("Not Logged In"))
                                    {
                                        GlobusLogHelper.log.Info("Not Logged in with : " + Username);
                                        GlobusLogHelper.log.Debug("Not Logged in with : " + Username);
                                        return;
                                    }
                                    if (commentResponse.Contains("errorSummary"))
                                    {
                                        try
                                        {
                                            string summary = GlobusHttpHelper.ParseJson(commentResponse, "errorSummary");
                                            string errorDescription = GlobusHttpHelper.ParseJson(commentResponse, "errorDescription");
                                            GlobusLogHelper.log.Info("Posting Error: " + summary + " | Error Description: " + errorDescription);
                                            GlobusLogHelper.log.Debug("Posting Error: " + summary + " | Error Description: " + errorDescription);


                                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, minDelayFanPagePoster * 1000);
                                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Posted on " + CountPostWall + "  Posted URL :" + Uri.UnescapeDataString(add_comment_text_text) + " comments with " + Username + " on Wall : " + FanpageUrl);
                                    GlobusLogHelper.log.Debug("Posted on " + CountPostWall + "  Posted URL :" + Uri.UnescapeDataString(add_comment_text_text) + " comments with " + Username + " on Wall : " + FanpageUrl);

                                    try
                                    {
                                        string CSVHeaders = "UserName" + "," + "PostUrl" + "," + "PostMessage";
                                        string CSV_Contents = Username + "," + FanpageUrl + "," + Uri.UnescapeDataString(add_comment_text_text);
                                        //    Utils.ExportDataCSVFile(CSVHeaders, CSV_Contents, Globals.path_PostComments);                                  

                                        int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, minDelayFanPagePoster * 1000);
                                        GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                                    }
                                    CountPostWall++;

                                    break;
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        postsCount++;
                  
                }
               
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

            GlobusLogHelper.log.Info("Process Completed With Username >>>" + Username);
            GlobusLogHelper.log.Debug("Process Completed With Username >>>" + Username);
        }
예제 #2
0
        public List<string>  PostOnPageWallFacebooker(string Keyword, ref FacebookUser fbUser)
        {
            List<string> FanPageUrls = new List<string>();

            try
            {
                #region Post variable

                string fbpage_id = string.Empty;            
                string __user = string.Empty;
            

                #endregion

                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
                #region MyRegion
                //Array paramArray = new object[8];
                //paramArray = (Array)postParams;

                //string Username = (string)paramArray.GetValue(0);
                //string Password = (string)paramArray.GetValue(1);
                //string proxyAddress = (string)paramArray.GetValue(2);
                //string proxyPort = (string)paramArray.GetValue(3);
                //string proxyUserName = (string)paramArray.GetValue(4);
                //string proxyPassword = (string)paramArray.GetValue(5);
                //string Keyword = (string)paramArray.GetValue(6);
                //string Message = (string)paramArray.GetValue(7);

                // string  campaignName = (string)paramArray.GetValue(8);





                //if (fbLoginChecker.CheckLogin(ResponseLogin, Username, Password)) 
                #endregion
                //
                GlobusLogHelper.log.Debug("Searching Fan Page Using keyword: " + Keyword);
                GlobusLogHelper.log.Info("Searching Fan Page Using keyword: " + Keyword);
                string pgSrc_FanPageSearch = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/search.php?q=" + Keyword + "&type=pages"));

                __user = GlobusHttpHelper.GetParamValue(pgSrc_FanPageSearch, "user");
                if (string.IsNullOrEmpty(__user))
                {
                    __user = GlobusHttpHelper.ParseJson(pgSrc_FanPageSearch, "user");
                }

                string AjaxRequest = Utils.getBetween(pgSrc_FanPageSearch, "href=\"#\" ajaxify=", "type=pages");
                AjaxRequest = "https://www.facebook.com"+AjaxRequest.Replace("\"", string.Empty).Replace("amp;", string.Empty) + "type=pages";

                List<string> pagesList = GetPages_FBSearch(pgSrc_FanPageSearch);

                List<string> distinctPages = pagesList.Distinct().ToList();

                ///More Pages
                string ajaxRequestURL = GetAjaxURL_MoreResults(pgSrc_FanPageSearch);
                ajaxRequestURL = "https://www.facebook.com/" + ajaxRequestURL + "&__a=1&__user="******"";

                ajaxRequestURL = Uri.UnescapeDataString(ajaxRequestURL) + "&init=quick";

                string res_ajaxRequest = HttpHelper.getHtmlfromUrl(new Uri(ajaxRequestURL));

                #region for find friend Reqest Link

                List<string> list = new List<string>();
                List<string> lstLinkData = new List<string>();

                string[] Linklist = System.Text.RegularExpressions.Regex.Split(res_ajaxRequest, "href=");

                foreach (string itemurl in Linklist)
                {
                    if (!itemurl.Contains("<!DOCTYPE html"))
                    {
                        if (itemurl.Contains(@"https:\/\/www.facebook.com"))
                        {
                            lstLinkData.Add(itemurl);
                            string strLink = itemurl.Substring(0, 70);
                            if (strLink.Contains("https:\\/\\/www.facebook.com") && (strLink.Contains("onclick") || strLink.Contains("data-gt=\\")))
                            {
                                try
                                {
                                    string[] tempArr = strLink.Split('"');
                                    string temp = tempArr[1];
                                    temp = temp.Replace("\\", "");
                                    list.Add(temp);

                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine(ex.Message);
                                }
                            }
                        }
                    }
                }
                #endregion
                list = list.Distinct().ToList();
                distinctPages.AddRange(list);
                FanPageUrls = distinctPages;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);               
            }
            return FanPageUrls;
        }
예제 #3
0
        public void StartCmpFanPageLikerProcess(ref FacebookUser fbUser, string cmpName, string cmpProcess, string account, List<string> lstFanPageURLs, List<string> lstFanPageMessages, List<string> lstFanPageComments)
        {
            try
            {
                Pages.PageManager objPageManager = new Pages.PageManager();

                if (cmpProcess == "Like Page")
                {
                    objPageManager.LikePage(ref fbUser, lstFanPageURLs);
                }

                else if (cmpProcess == "Share Page")
                {
                    objPageManager.SharePage(ref fbUser, lstFanPageURLs);
                }
                else if (cmpProcess == "Like Post")
                {
                    objPageManager.LikePost(ref fbUser, lstFanPageURLs, lstFanPageMessages);
                }
                else if (cmpProcess == "Comment On Post")
                {
                    objPageManager.CommentOnPost(ref fbUser, lstFanPageURLs, lstFanPageComments);
                }
                else
                {
                    GlobusLogHelper.log.Info("Campaign Process Is Not Selected With Username : "******"Campaign Process Is Not Selected With Username : "******"Error : " + ex.StackTrace);
            }
        }
예제 #4
0
        public void LikePostUpdatedMethodNew(ref FacebookUser fbUser, List<string> lstFanpageURLs, List<string> lstFanpageMessages)
        {
            try
            {
                int CounterLikePost = 1;
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
                string link_data = string.Empty;

                #region Post variable

                string post_form_id = string.Empty;
                string fbpage_id = string.Empty;
                string fb_dtsg = string.Empty;
                string __user = string.Empty;
                string xhpc_composerid = string.Empty;
                string xhpc_targetid = string.Empty;
                string xhpc_composerid12 = string.Empty;
                int NoOfEmailAccount = 20;
                string message = string.Empty;
                int noOfPosts = NoOfPostFanPageLikercount;
                List<string> arrftentidentifier_itemList = new List<string>();

                #endregion

                GlobusLogHelper.log.Info("Start Like Post  with " + fbUser.username);
                GlobusLogHelper.log.Debug("Start Like Post  with " + fbUser.username);
                queFanPageURLsFanPageLiker.Clear();
                queFanPageMessagesFanPageLiker.Clear();
                foreach (string item in lstFanpageURLs)
                {
                    PageManager.queFanPageURLsFanPageLiker.Enqueue(item);
                }
                foreach (string item in lstFanpageMessages)
                {
                    PageManager.queFanPageMessagesFanPageLiker.Enqueue(item);
                }
                string FanpageUrl = "";//(string)paramArray.GetValue(6);

                string ResponseLogin = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));
                __user = GlobusHttpHelper.GetParamValue(ResponseLogin, "user");
                if (string.IsNullOrEmpty(__user))
                {
                    __user = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
                }
                if (string.IsNullOrEmpty(__user) || __user == "0" || __user.Length < 3)
                {
                    GlobusLogHelper.log.Info("Please Check The Account : " + fbUser.username);
                    GlobusLogHelper.log.Debug("Please Check The Account : " + fbUser.username);
                    return;
                }
                string pageSource1 = ResponseLogin;
                //JS, CSS, Image Requests
                //RequestsJSCSSIMG.RequestJSCSSIMG(pageSource1, ref HttpHelper);
                string Keys = string.Empty;
                string Dc = string.Empty;                
               
                if (ResponseLogin.Contains("fb_dtsg"))
                {
                    fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");
                }
                if (ResponseLogin.Contains("post_form_id"))
                {
                    post_form_id = GlobusHttpHelper.GetParamValue(ResponseLogin, "post_form_id");
                }
                foreach (string FanPageUrl in queFanPageURLsFanPageLiker)
                {
                    GlobusLogHelper.log.Info("Start Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username);
                    GlobusLogHelper.log.Debug("Start Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username);
                    string FanUrl = string.Empty;
                    string FanName = string.Empty;
                    List<string> lstPostID = new List<string>();
                    FanUrl = FanPageUrl;
                    FanUrlCounter++;


                    if (FanUrl.Contains("?sk=wall"))
                    {
                        FanUrl = FanUrl.Remove(FanUrl.IndexOf("?sk=wall"));
                    }

                    FanUrl = FanUrl + "?sk=wall";

                    string FanPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanUrl));
                    if (string.IsNullOrEmpty(FanPageSrc))
                    {
                        FanPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanUrl));
                    }

                    if (string.IsNullOrEmpty(FanPageSrc))
                    {
                        GlobusLogHelper.log.Info("The page could not be found :- " + FanPageSrc);
                        GlobusLogHelper.log.Debug("The page could not be found :- " + FanPageSrc);
                        continue;
                    }
                    string pageId = string.Empty;
                    pageId=Utils.getBetween(FanPageSrc,"pageID\":",",");
                    fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(FanPageSrc);
                    string[] splitFanUrl = FanUrl.Split('/');
                    FanName = splitFanUrl[splitFanUrl.Length - 1].Split('?')[0];
                    string[] fanDetails = Regex.Split(FanPageSrc, "href=");
                    foreach (string item in fanDetails)
                    {
                        try
                        {
                            if (item.Contains(FanName + "/photos"))
                            {
                                string[] itemSplits = item.Split('/');
                                lstPostID.Add(itemSplits[4]);
                            }

                            if (item.Contains(FanName + "/posts"))
                            {
                                string[] itemSplits = item.Split('/');
                                lstPostID.Add(itemSplits[3].Substring(0, itemSplits[3].IndexOf('"')));
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(ex.Message);
                        }
                    }
                    lstPostID = lstPostID.Distinct().ToList();

                    int postLoaded = 1;
                    if (NoOfPostFanPageLikercount <= lstPostID.Count)
                    {
                        
                        //while (true)
                            for (int i = 1; i <= 5;i++ )
                            {
                                string paginationUrl = "https://www.facebook.com/ajax/pagelet/generic.php/PagePostsSectionPagelet?data=%7B%22segment_index%22%3A1%2C%22page_index%22%3A0%2C%22page%22%3A344128252278047%2C%22column%22%3A%22main%22%2C%22post_section%22%3A%7B%22profile_id%22%3A"+pageId+"%2C%22start%22%3A0%2C%22end%22%3A1425196799%2C%22query_type%22%3A36%2C%22filter%22%3A1%2C%22is_pages_redesign%22%3Atrue%7D%2C%22section_index%22%3A0%2C%22hidden%22%3Afalse%2C%22posts_loaded%22%3A" + i + "%2C%22show_all_posts%22%3Afalse%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzESu49UJ6K4Qmmey8szoyfwgo&__req=d&__rev=1583304";
                               
                                String PaginationSrc = HttpHelper.getHtmlfromUrl(new Uri(paginationUrl));
                                
                                PaginationSrc = PaginationSrc.Replace("\\", string.Empty);
                                splitFanUrl = FanUrl.Split('/');
                                FanName = splitFanUrl[splitFanUrl.Length - 1].Split('?')[0];
                                fanDetails = Regex.Split(FanPageSrc, "href=");
                                foreach (string item in fanDetails)
                                {
                                    try
                                    {
                                        if (item.Contains(FanName + "/photos"))
                                        {
                                            string[] itemSplits = item.Split('/');
                                            lstPostID.Add(itemSplits[4]);
                                        }

                                        if (item.Contains(FanName + "/posts"))
                                        {
                                            string[] itemSplits = item.Split('/');
                                            lstPostID.Add(itemSplits[3].Substring(0, itemSplits[3].IndexOf('"')));
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error(ex.Message);
                                    }
                                }
                                lstPostID = lstPostID.Distinct().ToList();

                            }

                            for (int i = 1; i <= 5; i++)
                            {
                                string paginationUrl = "https://www.facebook.com/ajax/pagelet/generic.php/PagePostsSectionPagelet?data=%7B%22segment_index%22%3A1%2C%22page_index%22%3A0%2C%22page%22%3A344128252278047%2C%22column%22%3A%22main%22%2C%22post_section%22%3A%7B%22profile_id%22%3A"+pageId+"%2C%22start%22%3A1388563200%2C%22end%22%3A1420099199%2C%22query_type%22%3A8%2C%22filter%22%3A1%2C%22is_pages_redesign%22%3Atrue%2C%22filter_after_timestamp%22%3A1417691399%7D%2C%22section_index%22%3A1%2C%22hidden%22%3Afalse%2C%22posts_loaded%22%3A"+i+"%2C%22show_all_posts%22%3Afalse%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzESu49UJ6K4Qmmey8szoyfwgo&__req=1g&__rev=1583304";

                                String PaginationSrc = HttpHelper.getHtmlfromUrl(new Uri(paginationUrl));

                                PaginationSrc = PaginationSrc.Replace("\\", string.Empty);
                                splitFanUrl = FanUrl.Split('/');
                                FanName = splitFanUrl[splitFanUrl.Length - 1].Split('?')[0];
                                fanDetails = Regex.Split(FanPageSrc, "href=");
                                foreach (string item in fanDetails)
                                {
                                    try
                                    {
                                        if (item.Contains(FanName + "/photos"))
                                        {
                                            string[] itemSplits = item.Split('/');
                                            lstPostID.Add(itemSplits[4]);
                                        }

                                        if (item.Contains(FanName + "/posts"))
                                        {
                                            string[] itemSplits = item.Split('/');
                                            lstPostID.Add(itemSplits[3].Substring(0, itemSplits[3].IndexOf('"')));
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error(ex.Message);
                                    }
                                }
                                lstPostID = lstPostID.Distinct().ToList();

                            }

                      
                        
                    
                    }

                    string likeUrl = "https://www.facebook.com/ajax/ufi/like.php";
                    string likeResp = string.Empty;
                    if (lstPostID.Count < NoOfPostFanPageLikercount)
                    {
                        foreach (string postId in lstPostID)
                        {
                            string postDataForLike = "like_action=true&ft_ent_identifier=" + postId + "&source=22&client_id=1422878573638%3A4272606515&rootid=u_ps_0_0_h&ft[tn]=%3E]&ft[fbfeed_location]=36&nctr[_mod]=pagelet_timeline_main_column&av=" + __user + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzESu49UJ6K4Qmmey8szoyfwgo&__req=1s&fb_dtsg=" + fb_dtsg + "&ttstamp=2658172108677512111549114121121&__rev=1583304";
                            try
                            {
                                likeResp = HttpHelper.postFormData(new Uri(likeUrl), postDataForLike);
                            }
                            catch { }

                            if (likeResp.Contains("UFI\\/LikeActive"))
                            {
                                GlobusLogHelper.log.Info("Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username + " With Post Id : " + postId);
                                GlobusLogHelper.log.Debug("Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username + " With Post Id : " + postId);
                            }

                            int delay = new Random().Next(minDelayFanPageLiker, maxDelayFanPageLiker);
                            GlobusLogHelper.log.Info("Like Post, Delaying For " + delay + " Seconds");
                            GlobusLogHelper.log.Debug("Like Post, Delaying For " + delay + " Seconds");
                            Thread.Sleep(delay * 1000);
                        }
                    }
                    else
                    {
                        for (int k = 0; k < NoOfPostFanPageLikercount; k++)
                        {
                            string postDataForLike = "like_action=true&ft_ent_identifier=" + lstPostID[k] + "&source=22&client_id=1422878573638%3A4272606515&rootid=u_ps_0_0_h&ft[tn]=%3E]&ft[fbfeed_location]=36&nctr[_mod]=pagelet_timeline_main_column&av=" + __user + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzESu49UJ6K4Qmmey8szoyfwgo&__req=1s&fb_dtsg=" + fb_dtsg + "&ttstamp=2658172108677512111549114121121&__rev=1583304";
                            try
                            {
                                likeResp = HttpHelper.postFormData(new Uri(likeUrl), postDataForLike);
                            }
                            catch { }

                            if (likeResp.Contains("UFI\\/LikeActive"))
                            {
                                GlobusLogHelper.log.Info("Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username + " With Post Id : " + lstPostID[k]);
                                GlobusLogHelper.log.Debug("Like Post On the URL : " + FanPageUrl + "  with " + fbUser.username + " With Post Id : " + lstPostID[k]);
                            }

                            int delay = new Random().Next(minDelayFanPageLiker, maxDelayFanPageLiker);
                            GlobusLogHelper.log.Info("Like Post, Delaying For " + delay + " Seconds");
                            GlobusLogHelper.log.Debug("Like Post, Delaying For " + delay + " Seconds");
                            Thread.Sleep(delay * 1000);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #5
0
        public string GetFriendUserId(ref FacebookUser fbUser, string profileUrl)
        {
            string FriendsId = string.Empty;
            try
            {

                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
                string pageSource = string.Empty;
                string Profile_Id = profileUrl;
                string ProfileNewUrl = string.Empty;

                profileUrl = profileUrl.Replace("https://www.facebook.com", "https://graph.facebook.com");
                if (profileUrl.Contains("profile.php?"))
                {
                    profileUrl = profileUrl.Replace("profile.php?id=", string.Empty);
                }
                pageSource = HttpHelper.getHtmlfromUrl(new Uri(profileUrl));

                FriendsId = getBetween(pageSource, "\"id\": \"", "\",\n");
                if (string.IsNullOrEmpty(FriendsId) || !Utils.IsNumeric(FriendsId))
                {
                    FriendsId = Utils.getBetween(Profile_Id, "php?id=", "&");
                    ProfileNewUrl = "https://graph.facebook.com/" + FriendsId;
                    pageSource = HttpHelper.getHtmlfromUrl(new Uri(ProfileNewUrl));
                    FriendsId = getBetween(pageSource, "\"id\": \"", "\",\n");

                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }


            return FriendsId;
        }
예제 #6
0
        public void StartFanPageLikerProcess(ref FacebookUser fbUser)
        {
            try
            {
                if (StartProcessUsingFanPageLiker == "Like Page")
                {
                    LikePage(ref fbUser, lstFanPageUrlsFanPageLiker);
                }

                if (StartProcessUsingFanPageLiker == "Share Page")
                {
                    SharePage(ref fbUser, lstFanPageUrlsFanPageLiker);
                }

                if (StartProcessUsingFanPageLiker == "Like Post" && !isLikePostThroughFreindsUrls)
                {
                    //LikePostUpdatedMethod(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageMessageFanPageLiker);
                    LikePostUpdatedMethodNew(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageMessageFanPageLiker);
                }

                if (StartProcessUsingFanPageLiker == "Comment On Post")
                {
                    
                    if (lstFanPageCommentsFanPageLiker.Count == 0)
                    {
                        GlobusLogHelper.log.Info("Please Upload Fan Page Comments..! ");
                        GlobusLogHelper.log.Debug("Please Upload Fan Page Comments..! ");
                        return;
                    }
                    CommentOnPost2(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
                   // CommentOnPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
                     GlobusLogHelper.log.Info("Process completed With :" +fbUser.username);
                     GlobusLogHelper.log.Debug("Process completed With :" + fbUser.username);
                }
                if (StartProcessUsingFanPageLiker == "Comment On Recent Post")
                {
                    //CommentOnPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
                    CommentOnRescentPost(ref fbUser, lstFanPageUrlsFanPageLiker, lstFanPageCommentsFanPageLiker);
                    GlobusLogHelper.log.Info("Process completed With :" + fbUser.username);
                    GlobusLogHelper.log.Debug("Process completed With :" + fbUser.username);
                }
                if (StartProcessUsingFanPageLiker == "Like Post" && isLikePostThroughFreindsUrls)
                {
                    LikePostsOnFreindsPage(ref fbUser, lstFreindsPagePostsLiker);                  
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #7
0
        public void SharePage(ref FacebookUser fbUser, List<string> lstFanPageUrlsFanPageLiker)
        {
            try
            {
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

                #region Post variable

                string fbpage_id = string.Empty;
                string fb_dtsg = string.Empty;
                string __user = string.Empty;
                string xhpc_composerid = string.Empty;
                string xhpc_targetid = string.Empty;
                string xhpc_composerid12 = string.Empty;
                int NoOfEmailAccount = 20;
                int NoOfcount = 0;

                #endregion

                List<string> FanpageUrls = lstFanPageUrlsFanPageLiker;//(List<string>)paramArray.GetValue(6);

                foreach (string item in FanpageUrls)
                {
                    try
                    {
                        string FanpageUrl = item;

                        string PageSrcFanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));

                        GlobusLogHelper.log.Info("Started Sharing Page : " + FanpageUrl + " With UserName : "******"Started Sharing Page : " + FanpageUrl + " With UserName : "******"user");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
                        if (string.IsNullOrEmpty(__user))
                        {
                            __user = GlobusHttpHelper.ParseJson(PageSrcFanPageUrl, "user");
                        }

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

                            return;
                        }

                        fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(PageSrcFanPageUrl);

                        string appid = string.Empty;
                        string PValue = string.Empty;
                        string ImageUrl = string.Empty;
                        try
                        {
                            try
                            {
                                appid = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("appid="), (PageSrcFanPageUrl.IndexOf("&", PageSrcFanPageUrl.IndexOf("appid=")) - PageSrcFanPageUrl.IndexOf("appid="))).Replace("appid=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
                            }
                            catch(Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                            if (appid.Length > 15)
                            {
                                appid = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("appid="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("appid=")) - PageSrcFanPageUrl.IndexOf("appid="))).Replace("appid=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);

                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        try
                        {
                            try
                            {
                                PValue = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("p[]="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("p[]=")) - PageSrcFanPageUrl.IndexOf("p[]="))).Replace("p[]=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
                                if (PValue.Contains(",idnull,") || PValue.Contains(","))
                                {
                                    PValue = PValue.Split(',')[0];
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            if (appid.Length > 15)
                            {
                                PValue = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("p[]="), (PageSrcFanPageUrl.IndexOf(" ", PageSrcFanPageUrl.IndexOf("p[]=")) - PageSrcFanPageUrl.IndexOf("p[]="))).Replace("p[]=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty);
                               

                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        string Sharepageresponse = string.Empty;
                        try
                        {
                            Sharepageresponse = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerFanPageGetsharerAppId + appid + "&p[0]=" + PValue + "&__asyncDialog=1&__user="******"&__a=1&__req=9"));
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        string Attachmaentparam = string.Empty;
                        string AttachmaentType = string.Empty;
                        try
                        {
                            string[] regparamArr = Regex.Split(Sharepageresponse, "attachment");

                            foreach (var Attachitem in regparamArr)
                            {
                                try
                                {
                                    if (Attachitem.Contains("[params][0]"))
                                    {
                                        try
                                        {
                                            Attachmaentparam = (Attachitem.Substring(Attachitem.IndexOf("value="), Attachitem.IndexOf("/>", Attachitem.IndexOf("value=")) - Attachitem.IndexOf("value=")).Replace("value=", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }


                                    if (Attachitem.Contains("[type]"))
                                    {
                                        try
                                        {
                                            AttachmaentType = (Attachitem.Substring(Attachitem.IndexOf("value="), Attachitem.IndexOf("/>", Attachitem.IndexOf("value=")) - Attachitem.IndexOf("value=")).Replace("value=", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                            if (Sharepageresponse.Contains("appid") && string.IsNullOrEmpty(appid))
                            {
                                try
                                {
                                    string[] AppidArr = Regex.Split(Sharepageresponse, "appid");
                                    appid = (AppidArr[1].Substring(AppidArr[1].IndexOf("value="), AppidArr[1].IndexOf("/>", AppidArr[1].IndexOf("value=")) - AppidArr[1].IndexOf("value=")).Replace("value=", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());

                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {
                            ImageUrl = Sharepageresponse.Substring(Sharepageresponse.IndexOf("url="), (Sharepageresponse.IndexOf(" ", Sharepageresponse.IndexOf("url=")) - Sharepageresponse.IndexOf("url="))).Replace("url=", string.Empty).Replace("\"", string.Empty).Replace(":", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("u00252F", string.Empty).Replace("u00253A", string.Empty);//.Replace("\\\\","://");
                            ImageUrl = ImageUrl.Replace("http", "https://");
                            ImageUrl = Uri.EscapeDataString(ImageUrl);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {
                            string postdataforshare = "fb_dtsg=" + fb_dtsg + "&ad_params=&friendTarget=&groupTarget=&mode=self&message=&attachment[params][0]=" + Attachmaentparam + "&attachment[params][images][0]=" + ImageUrl + "&attachment[type]=" + AttachmaentType + "&composer_link_best_image_w=180&composer_link_best_image_h=180&composer_link_image_selected=0&composer_link_images_provided=1&composer_link_images_loaded=1&composer_link_images_shown=1&composer_link_load_duration=404&composer_link_sort_order=0&composer_link_selector_type=UIThumbPager_3&src=i&appid=" + appid + "&parent_fbid=&ogid=&audience[0][value]=80&__user="******"&__a=1&__req=a&phstamp=165816810410410112277635";
                            string response = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPagePostSharerSubmit), postdataforshare);
                            if (!response.Contains("errorSummary") || !response.Contains("error"))
                            {
                                try
                                {
                                    TotalFanPagelikeCounter++;
                                    NoOfcount++;

                                    GlobusLogHelper.log.Info("Shared " + FanpageUrl + "  with " + fbUser.username + "<:>" + TotalFanPagelikeCounter.ToString());
                                    GlobusLogHelper.log.Debug("Shared " + FanpageUrl + "  with " + fbUser.username + "<:>" + TotalFanPagelikeCounter.ToString());

                                    //GlobusLogHelper.log.Info("Page Shared : " + item + "Using UserName : "******"Page Shared : " + item + "Using UserName : "******"UserName" + "," + "FanpageUrl";
                                    string CSV_Content = fbUser.username + "," + FanpageUrl;
                                    //CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_SharedPages);
                                    
                                    int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                                    GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                                }
                            }
                            else
                            {
                                if (response.Contains("errorSummary"))
                                {
                                    try
                                    {
                                        GlobusLogHelper.log.Info("Page Not Shared : " + item + "Using UserName : "******"Page Not Shared : " + item + "Using UserName : "******"UserName" + "," + "FanpageUrl";
                                        string CSV_Content = fbUser.username + "," + FanpageUrl;

                                        //CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_ErrorSharedPages);

                                        int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                                        GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                    if(NoOfPostFanPageLikercount==NoOfcount)
                    {
                        break;
                    }
                }
                GlobusLogHelper.log.Info("Process completed with :  "+ fbUser.username );
                GlobusLogHelper.log.Debug("Process completed with :  " + fbUser.username);
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #8
0
 public void UploadImageOnPage(ref FacebookUser fbUser)
 {
     try
     {
         foreach (string item in lstFanPageUrlCollectionFanPagePoster)
         {
             try
             {
                 StartImageUploadingOnPage(ref fbUser, item);
             }
             catch (Exception ex)
             {
                 GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
             }
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }
예제 #9
0
        public void StartImageUploadingOnPage(ref FacebookUser fbUser, string PageUrl)
        {
          GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

            string strUserName = fbUser.username;
            string strProxyAddress = fbUser.proxyusername;
            string strProxyUserName = fbUser.proxyusername;
            string strProxyPassword = fbUser.proxypassword;
            string strProxyPort = fbUser.proxyport;

            try
            {
                GlobusLogHelper.log.Debug(" Starting Image Upload With Username : "******" On The URL : " + PageUrl);
                GlobusLogHelper.log.Info(" Starting Image Upload With Username : "******" On The URL : " + PageUrl);

                string pics = string.Empty;
                string message = string.Empty;
                string pageId = string.Empty;
                string session_id = string.Empty;
                string grid_Id = string.Empty;
                string waterfallId=string.Empty;

                if (string.IsNullOrEmpty(strProxyPort))
                {
                    strProxyPort = "80";
                }

                string res_Home = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));     //"https://www.facebook.com/"

                string __user = GlobusHttpHelper.GetParamValue(res_Home, "user");
                if (string.IsNullOrEmpty(__user))
                {
                    __user = GlobusHttpHelper.ParseJson(res_Home, "user");
                }

                string fb_dtsg = Get_fb_dtsg(res_Home);
                string res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(PageUrl));
                string ComposerId = string.Empty;
                pageId = Utils.getBetween(res_get_FanPage, "{\"pageID\":\"", "\"}]]]");
               
                ComposerId=Utils.getBetween(res_get_FanPage,"composerid\" value=\"","\"");
                #region for
                for (int i = 0; i < noOfPicsPerURL; i++)
                {
                    try
                    {
                        if (picsCounter < lstPicturecollectionPostPicOnFanPageWall.Count)
                        {
                            pics = lstPicturecollectionPostPicOnFanPageWall[picsCounter];
                            picsCounter++;
                        }
                        else
                        {
                            GlobusLogHelper.log.Debug("All pics used up : " + strUserName);
                            GlobusLogHelper.log.Info("All pics used up : " + strUserName);
                            return;
                        }

                        if (lstFanPageCollectionFanPagePosterMessage.Count > 0)
                        {
                            message = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
                        }
                        string ImagePostClickResp = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/composerx/attachment/media/upload/?av=" + __user + "&composerurihash=1"), "fb_dtsg=" + fb_dtsg + "&composerid=" + ComposerId + "&targetid=" + pageId + "&composercontext=composer&isfinch=1&loaded_components[0]=maininput&loaded_components[1]=withtaggericon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=mainprivacywidget&loaded_components[5]=withtaggericon&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_main_column&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgSmEVFLFwxBxvyUW5ogDyQqUjhpoW8xOdy8-&__req=g&ttstamp=2658170819911711579109529989&__rev=1561259");
                        grid_Id = Utils.getBetween(ImagePostClickResp, "\"gridID\":\"", "\"");
                        waterfallId=Utils.getBetween(ImagePostClickResp,"\"waterfallID\":\"","\""); 
                        NameValueCollection nvc = new NameValueCollection();
                        nvc.Add("fb_dtsg",fb_dtsg);
                        nvc.Add("source","8");
                        nvc.Add("profile_id",__user);
                        nvc.Add("grid_id",grid_Id);
                        nvc.Add("qn",waterfallId);
                        nvc.Add("0", "" + pics + "<:><:><:>image/jpeg");
                        nvc.Add("upload_id", "1024");
                        string imgUploadResp = HttpHelper.UploadImageWaterfallModel("https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id=" + pageId + "&image_height=100&image_width=100&letterbox=0&av=" + __user + "&qn=" + waterfallId + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4pbGAdBGeqrWo8ponUKexm49UJ6K4Qmmey8szoyfw&__req=p&fb_dtsg=" + fb_dtsg + "&ttstamp=2658170819911711579109529989&__rev=1561259", PageUrl, nvc, "upload_id", "0");

                        string UnPublishId = Utils.getBetween(imgUploadResp, "\"fbid\":\"", "\"");

                        NameValueCollection nvc1 = new NameValueCollection();
                        nvc1.Add("composer_session_id", "57c32c98-d4b9-4f5a-9fb9-6452e01e24bb");
                        nvc1.Add("fb_dtsg",fb_dtsg);
                        nvc1.Add("xhpc_context","profile");
                        nvc1.Add("xhpc_ismeta","1");
                        nvc1.Add("xhpc_timeline",string.Empty);
                        nvc1.Add("xhpc_composerid", ComposerId);
                        nvc1.Add("xhpc_finch", "1");
                        nvc1.Add("xhpc_targetid", pageId);
                        nvc1.Add("xhpc_publish_type", "1");
                        nvc1.Add("clp", "{\"cl_impid\":\"626b99df\",\"clearcounter\":0,\"elementid\":\"u_0_19\",\"version\":\"x\",\"parent_fbid\":"+pageId+"}");
                        nvc1.Add("xhpc_message",message);
                        nvc1.Add("composer_unpublished_photo[]",UnPublishId);
                        nvc1.Add("album_type","128");
                        nvc1.Add("is_file_form","1");
                        nvc1.Add("oid", string.Empty);
                        nvc1.Add("qn", waterfallId);
                        nvc1.Add("application","composer");
                        nvc1.Add("is_explicit_place",string.Empty);
                        nvc1.Add("composertags_place",string.Empty);
                        nvc1.Add("composertags_place_name", string.Empty);
                        nvc1.Add("tagger_session_id", "1421254406");
                        nvc1.Add("composertags_city",string.Empty);
                        nvc1.Add("disable_location_sharing","false");
                        nvc1.Add("composer_predicted_city",string.Empty);
                        string imgUploadResp1 = HttpHelper.UploadImageWaterfallModel("https://upload.facebook.com/media/upload/photos/composer/?av=" + __user + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4pbGAdBGeqrWo8ponUKexm49UJ6K4Qmmey8szoyfw&__req=x&fb_dtsg="+fb_dtsg+"&ttstamp=2658170819911711579109529989&__rev=1561259", PageUrl, nvc1, "composer_predicted_city", string.Empty);

                        string photoId=Utils.getBetween(imgUploadResp1,"photo_fbid\":",",\"story_fbid");
                        if (!string.IsNullOrEmpty(photoId))
                        {
                            GlobusLogHelper.log.Debug("Image Uploaded With Username : "******" On The URL : " + PageUrl);
                            GlobusLogHelper.log.Info("Image Uploaded With Username : "******" On The URL : " + PageUrl);

                            try
                            {
                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"UserName" + "," + "FanpageUrl" + "," + "Message";
                                        string CSV_Content = strUserName + "," + PageUrl + "," + pics;

                                        Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, GlobusFileHelper.DesktopFanFilePath);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Debug("Unable To Upload Image With Username : "******" On The URL : " + PageUrl);
                            GlobusLogHelper.log.Info("Unable To Upload Image With Username : "******" On The URL : " + PageUrl);
                        }


                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(ex.Message);
                    }

                       
                }

                #endregion
                

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(ex.Message);
            }

            GlobusLogHelper.log.Debug(" Process Completed Image Upload With Username : "******" On The URL : " + PageUrl);
            GlobusLogHelper.log.Info(" Process Completed Image Upload With Username : "******" On The URL : " + PageUrl);

        }
예제 #10
0
        public void PostOnFanPageWallWithURLAndItsImageNew(ref FacebookUser fbUser)
        {
            try
            {
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

                string Username = string.Empty;
                string Password = string.Empty;

                GlobusLogHelper.log.Debug("Please Wait------------!");
                GlobusLogHelper.log.Info("Please Wait------------!");

                Array paramArray = new object[10];
                string Userss = fbUser.username;

                int CountPostWall = 1;
                //string FanpageUrl = (string)paramArray.GetValue(6);
                lstFanPageUrlCollectionFanPagePoster = lstFanPageUrlCollectionFanPagePoster.Distinct().ToList();
                lstFanPageURLs = lstFanPageUrlCollectionFanPagePoster;
                lstFanPageUrlCollectionFanPagePostUrl = lstFanPageUrlCollectionFanPagePostUrl.Distinct().ToList();
                lstFanPagePostURLs = lstFanPageUrlCollectionFanPagePostUrl;

                string composer_session_id = "";
                string fb_dtsg = "";
                string xhpc_composerid = "";
                string xhpc_targetid = "";
                string xhpc_context = "";
                string xhpc_fbx = "";
                string xhpc_timeline = "";
                string xhpc_ismeta = "";
                string xhpc_message_text = "";
                string xhpc_message = "";

                #region MyRegion
                string uithumbpager_width = "128";
                string uithumbpager_height = "128";
                string composertags_place = "";
                string composertags_place_name = "";
                string composer_predicted_city = "";
                string is_explicit_place = "";
                string composertags_city = "";
                string disable_location_sharing = "false";
                string audiencevalue = "80";
                string nctr_mod = "pagelet_timeline_recent";
                string UsreId = "";
                string __a = "1";
                string phstamp = "";
                #endregion

                Username = Userss;

                GlobusLogHelper.log.Info("Start Process of Wall Posting With Username.... >>> " + Username);
                GlobusLogHelper.log.Debug("Start Process of Wall Posting With Username.... >>> " + Username);


                int Counter = 0;
                foreach (var lstFanPageURLsitem in lstFanPageURLs)
                {

                    while (true)
                    {

                        Counter = Counter + 1;
                        try
                        {
                            //Counter = Counter + 1;
                            if (Counter > noOfPicsPerURL)
                            {
                                break;
                            }

                            string strFanPageURL = lstFanPageURLsitem;
                            string strPageSource = HttpHelper.getHtmlfromUrl(new Uri(strFanPageURL));

                            if (strPageSource.Contains("xhpc_composerid") && strPageSource.Contains("xhpc_targetid") && strPageSource.Contains("xhpc_context")) //&& strPageSource.Contains("xhpc_fbx")
                            {
                                UsreId = GlobusHttpHelper.Get_UserID(strPageSource);
                                fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(strPageSource);

                                xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_composerid");
                                xhpc_targetid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_targetid");
                                xhpc_context = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");
                                xhpc_fbx = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_fbx");
                                xhpc_timeline = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_timeline");
                                xhpc_ismeta = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_ismeta");

                                xhpc_message_text = lstFanPagePostURLs[new Random().Next(0, lstFanPagePostURLs.Count)];
                                xhpc_message = xhpc_message_text;
                                //lstFanPagePostURLs.Remove(xhpc_message);
                                //xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");
                                //xhpc_composerid = GlobusHttpHelper.GetParamValue(strPageSource, "xhpc_context");


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

                                string composer_session_idSource = HttpHelper.getHtmlfromUrl(new Uri(faceboardpro.FBGlobals.Instance.pageFanPageAjaxMetaComposerTargetidUrl + UsreId + "&xhpc=composerTourStart&nctr[_mod]=pagelet_composer&__user="******"&__a=1"));//Convert.ToInt32(ConvertToUnixTimestamp(DateTime.Now)).ToString();
                                if (composer_session_idSource.Contains("composer_session_id"))
                                {
                                    composer_session_id = (composer_session_idSource.Substring(composer_session_idSource.IndexOf("composer_session_id"), composer_session_idSource.IndexOf("/>", composer_session_idSource.IndexOf("composer_session_id")) - composer_session_idSource.IndexOf("composer_session_id")).Replace("composer_session_id", string.Empty).Replace("value=", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());

                                }

                                string strImageValue = HttpHelper.getHtmlfromUrl(new Uri(faceboardpro.FBGlobals.Instance.pageFanPageUrlAjaxMetacomposerLinkUrl + Uri.EscapeDataString(xhpc_message_text) + "&alt_scrape_url=" + Uri.EscapeDataString(xhpc_message_text) + "&targetid=" + UsreId + "&xhpc=composerTourStart&nctr[_mod]=pagelet_composer&__user="******"&__a=1"));   //https://www.facebook.com/ajax/metacomposer/attachment/link/scraper.php?scrape_url=http%253A%252F%252Fwww.google.co.in%252F&alt_scrape_url=http%253A%252F%252Fwww.google.co.in%252F&targetid=100003798185175&xhpc=composerTourStart&nctr[_mod]=pagelet_composer&__user=100003798185175&__a=1

                                string imageURL = xhpc_message_text;
                                try
                                {
                                    imageURL = HttpHelper.GetHrefsFromString(xhpc_message_text)[0];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                string post_URL_GetImageParams = faceboardpro.FBGlobals.Instance.PageFanPageUrlComposeLinkScraper + imageURL + "&composerurihash=3";
                                string post_Data_GetImageParams = "fb_dtsg=" + fb_dtsg + "&composerid=" + composer_session_id + "&targetid=" + xhpc_targetid + "&istimeline=1&composercontext=composer&loaded_components[0]=maininput&loaded_components[1]=mainprivacywidget&loaded_components[2]=maininput&loaded_components[3]=mainprivacywidget&loaded_components[4]=explicitplaceinput&loaded_components[5]=hiddenplaceinput&loaded_components[6]=placenameinput&loaded_components[7]=hiddensessionid&loaded_components[8]=withtagger&loaded_components[9]=placetagger&loaded_components[10]=withtaggericon&loaded_components[11]=citysharericon&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=7n8ahyj2tVBoeVag&__req=4n&phstamp=165816886688048122625";

                                string res_post_GetImageParams = HttpHelper.postFormData(new Uri(post_URL_GetImageParams), post_Data_GetImageParams);
                                strImageValue = res_post_GetImageParams;

                                Dictionary<string, string> dicNameValue = new Dictionary<string, string>();
                                string attachment_params_summary = string.Empty;
                                string attachment_params_images = string.Empty;
                                if (strImageValue.Contains("name=") && strImageValue.Contains("value="))
                                {
                                    try
                                    {
                                        string[] strNameValue = Regex.Split(strImageValue, "name=");
                                        foreach (var strNameValueitem in strNameValue)
                                        {
                                            try
                                            {
                                                if (strNameValueitem.Contains("value="))
                                                {
                                                    string strSplit = strNameValueitem.Substring(0, strNameValueitem.IndexOf("/>"));
                                                    if (strSplit.Contains("value="))
                                                    {

                                                        string strName = (strNameValueitem.Substring(0, strNameValueitem.IndexOf("value=") - 0).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());
                                                        strName = strName.Replace(">u003Coption", "");
                                                        if (strName == "fb_dtsg")
                                                        {

                                                            continue;
                                                        }
                                                        string strValue = (strNameValueitem.Substring(strNameValueitem.IndexOf("value="), strNameValueitem.IndexOf("/>", strNameValueitem.IndexOf("value=")) - strNameValueitem.IndexOf("value=")).Replace("value=", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());
                                                        if (strValue.Contains(">Year:u003C/option>"))
                                                        {
                                                            strValue = strValue.Replace("u003C", "<");
                                                            if (strValue.Contains("</option>"))
                                                            {
                                                                strValue = Utils.getBetween(strValue, "<option 2014>", "</option>");
                                                            }
                                                        }
                                                        if (strValue.Contains("Month:u003C/option>"))
                                                        {
                                                            strValue = strValue.Replace("u003C", "<");
                                                            if (strValue.Contains("</option>"))
                                                            {
                                                                strValue = Utils.getBetween(strValue, "<option 12>", "</option>");
                                                            }
                                                        }
                                                        strValue = (strValue);

                                                        if (strNameValueitem.Contains("attachment[params][summary]"))
                                                        {
                                                            attachment_params_summary = strValue;
                                                        }
                                                        if (strNameValueitem.Contains("attachment[params][images]"))
                                                        {
                                                            attachment_params_images = strValue;
                                                        }

                                                        dicNameValue.Add(strName, strValue);
                                                    }
                                                    else
                                                    {
                                                        string strName = (strNameValueitem.Substring(0, strNameValueitem.IndexOf("/>") - 0).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Trim());
                                                        if (strName == "fb_dtsg")
                                                        {
                                                            continue;
                                                        }
                                                        string strValue = "0";
                                                        strValue = (strValue);
                                                        dicNameValue.Add(strName, strValue);
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }


                                        string partPostData = string.Empty;
                                        foreach (var dicNameValueitem in dicNameValue)
                                        {
                                            partPostData = partPostData + dicNameValueitem.Key + "=" + dicNameValueitem.Value + "&";
                                        }

                                        string strPostData = ("fb_dtsg=" + fb_dtsg + "&xhpc_composerid=" + xhpc_composerid + "&xhpc_targetid=" + xhpc_targetid + "&xhpc_context=" + xhpc_context + "&xhpc_fbx=" + xhpc_fbx + "&xhpc_timeline=" + xhpc_timeline + "&xhpc_ismeta=" + xhpc_ismeta + "&xhpc_message_text=" + xhpc_message_text + "&xhpc_message=" + xhpc_message + "&" + partPostData + "uithumbpager_width=320&uithumbpager_height=180&composertags_place=&composertags_place_name=&composer_predicted_city=&composer_session_id=" + composer_session_id + "&is_explicit_place=&composertags_city=&disable_location_sharing=false&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&phstamp=16581671021075776692083");//fb_dtsg=AQB6MSsa&xhpc_composerid=uv6h8i_132&xhpc_targetid=185980263874&xhpc_context=profile&xhpc_fbx=&xhpc_timeline=1&xhpc_ismeta=1&xhpc_message_text=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw%26feature%3Drelated&xhpc_message=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw%26feature%3Drelated&aktion=post&app_id=2309869772&UIThumbPager_Input=0&attachment[params][metaTagMap][0][http-equiv]=content-type&attachment[params][metaTagMap][0][content]=text%2Fhtml%3B%20charset%3Dutf-8&attachment[params][metaTagMap][1][name]=title&attachment[params][metaTagMap][1][content]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][metaTagMap][2][name]=description&attachment[params][metaTagMap][2][content]=&attachment[params][metaTagMap][3][name]=keywords&attachment[params][metaTagMap][3][content]=Devon%2C%20ke%2C%20Dev%2C%20Mahadev%2C%2010th%2C%20July%2C%202012%2C%20Video%2C%20Watch%2C%20Online%2C%20Pt4&attachment[params][metaTagMap][4][property]=og%3Aurl&attachment[params][metaTagMap][4][content]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][metaTagMap][5][property]=og%3Atitle&attachment[params][metaTagMap][5][content]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][metaTagMap][6][property]=og%3Adescription&attachment[params][metaTagMap][6][content]=&attachment[params][metaTagMap][7][property]=og%3Atype&attachment[params][metaTagMap][7][content]=video&attachment[params][metaTagMap][8][property]=og%3Aimage&attachment[params][metaTagMap][8][content]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fmqdefault.jpg&attachment[params][metaTagMap][9][property]=og%3Avideo&attachment[params][metaTagMap][9][content]=http%3A%2F%2Fwww.youtube.com%2Fv%2Fa1hRe_xGuGw%3Fversion%3D3%26autohide%3D1&attachment[params][metaTagMap][10][property]=og%3Avideo%3Atype&attachment[params][metaTagMap][10][content]=application%2Fx-shockwave-flash&attachment[params][metaTagMap][11][property]=og%3Avideo%3Awidth&attachment[params][metaTagMap][11][content]=480&attachment[params][metaTagMap][12][property]=og%3Avideo%3Aheight&attachment[params][metaTagMap][12][content]=360&attachment[params][metaTagMap][13][property]=og%3Asite_name&attachment[params][metaTagMap][13][content]=YouTube&attachment[params][metaTagMap][14][property]=fb%3Aapp_id&attachment[params][metaTagMap][14][content]=87741124305&attachment[params][metaTagMap][15][name]=twitter%3Acard&attachment[params][metaTagMap][15][value]=player&attachment[params][metaTagMap][16][name]=twitter%3Asite&attachment[params][metaTagMap][16][value]=%40youtube&attachment[params][metaTagMap][17][name]=twitter%3Aplayer&attachment[params][metaTagMap][17][value]=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fa1hRe_xGuGw&attachment[params][metaTagMap][18][property]=twitter%3Aplayer%3Awidth&attachment[params][metaTagMap][18][content]=480&attachment[params][metaTagMap][19][property]=twitter%3Aplayer%3Aheight&attachment[params][metaTagMap][19][content]=360&attachment[params][metaTagMap][20][name]=attribution&attachment[params][metaTagMap][20][content]=youtube_none%2F&attachment[params][medium]=103&attachment[params][urlInfo][canonical]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][urlInfo][final]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][urlInfo][user]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw%26feature%3Drelated&attachment[params][favicon]=http%3A%2F%2Fs.ytimg.com%2Fyt%2Ffavicon-vfldLzJxy.ico&attachment[params][title]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][fragment_title]=&attachment[params][external_author]=&attachment[params][summary]=&attachment[params][url]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][video][0][type]=application%2Fx-shockwave-flash&attachment[params][video][0][src]=http%3A%2F%2Fwww.youtube.com%2Fv%2Fa1hRe_xGuGw%3Fversion%3D3%26autohide%3D1%26autoplay%3D1&attachment[params][video][0][width]=480&attachment[params][video][0][height]=360&attachment[params][video][0][v]=0&attachment[params][video][0][safe]=1&attachment[params][error]=1&attachment[params][og_info][properties][0][0]=og%3Aurl&attachment[params][og_info][properties][0][1]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][og_info][properties][1][0]=og%3Atitle&attachment[params][og_info][properties][1][1]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][og_info][properties][2][0]=og%3Adescription&attachment[params][og_info][properties][2][1]=&attachment[params][og_info][properties][3][0]=og%3Atype&attachment[params][og_info][properties][3][1]=video&attachment[params][og_info][properties][4][0]=og%3Aimage&attachment[params][og_info][properties][4][1]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fmqdefault.jpg&attachment[params][og_info][properties][5][0]=og%3Avideo&attachment[params][og_info][properties][5][1]=http%3A%2F%2Fwww.youtube.com%2Fv%2Fa1hRe_xGuGw%3Fversion%3D3%26autohide%3D1&attachment[params][og_info][properties][6][0]=og%3Avideo%3Atype&attachment[params][og_info][properties][6][1]=application%2Fx-shockwave-flash&attachment[params][og_info][properties][7][0]=og%3Avideo%3Awidth&attachment[params][og_info][properties][7][1]=480&attachment[params][og_info][properties][8][0]=og%3Avideo%3Aheight&attachment[params][og_info][properties][8][1]=360&attachment[params][og_info][properties][9][0]=og%3Asite_name&attachment[params][og_info][properties][9][1]=YouTube&attachment[params][og_info][properties][10][0]=fb%3Aapp_id&attachment[params][og_info][properties][10][1]=87741124305&attachment[params][og_info][properties][11][0]=twitter%3Aplayer%3Awidth&attachment[params][og_info][properties][11][1]=480&attachment[params][og_info][properties][12][0]=twitter%3Aplayer%3Aheight&attachment[params][og_info][properties][12][1]=360&attachment[params][og_info][guesses][0][0]=og%3Aurl&attachment[params][og_info][guesses][0][1]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][og_info][guesses][1][0]=og%3Atitle&attachment[params][og_info][guesses][1][1]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][og_info][guesses][2][0]=og%3Adescription&attachment[params][og_info][guesses][2][1]=&attachment[params][og_info][guesses][3][0]=og%3Aimage&attachment[params][og_info][guesses][3][1]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fmqdefault.jpg&attachment[params][og_info][guesses][4][0]=og%3Alocale&attachment[params][og_info][guesses][4][1]=en&attachment[params][responseCode]=200&attachment[params][redirectPath][0][status]=og%3Aurl&attachment[params][redirectPath][0][url]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][redirectPath][0][ip]=74.125.228.3&attachment[params][metaTags][title]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][metaTags][keywords]=Devon%2C%20ke%2C%20Dev%2C%20Mahadev%2C%2010th%2C%20July%2C%202012%2C%20Video%2C%20Watch%2C%20Online%2C%20Pt4&attachment[params][metaTags][attribution]=youtube_none%2F&attachment[params][locale]=en&attachment[params][lang]=en&attachment[params][links][0][rel]=search&attachment[params][links][0][type]=application%2Fopensearchdescription%2Bxml&attachment[params][links][0][href]=http%3A%2F%2Fwww.youtube.com%2Fopensearch%3Flocale%3Den_US&attachment[params][links][0][title]=YouTube%20Video%20Search&attachment[params][links][1][rel]=icon&attachment[params][links][1][href]=http%3A%2F%2Fs.ytimg.com%2Fyt%2Ffavicon-vfldLzJxy.ico&attachment[params][links][1][type]=image%2Fx-icon&attachment[params][links][2][rel]=shortcut%20icon&attachment[params][links][2][href]=http%3A%2F%2Fs.ytimg.com%2Fyt%2Ffavicon-vfldLzJxy.ico&attachment[params][links][2][type]=image%2Fx-icon&attachment[params][links][3][rel]=canonical&attachment[params][links][3][href]=%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][links][4][rel]=alternate&attachment[params][links][4][media]=handheld&attachment[params][links][4][href]=http%3A%2F%2Fm.youtube.com%2Fwatch%3Fdesktop_uri%3D%252Fwatch%253Fv%253Da1hRe_xGuGw%26v%3Da1hRe_xGuGw%26gl%3DUS&attachment[params][links][5][rel]=shortlink&attachment[params][links][5][href]=http%3A%2F%2Fyoutu.be%2Fa1hRe_xGuGw&attachment[params][links][6][rel]=alternate&attachment[params][links][6][type]=application%2Fjson%2Boembed&attachment[params][links][6][href]=http%3A%2F%2Fwww.youtube.com%2Foembed%3Furl%3Dhttp%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253Da1hRe_xGuGw%26format%3Djson&attachment[params][links][6][title]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][links][7][rel]=alternate&attachment[params][links][7][type]=text%2Fxml%2Boembed&attachment[params][links][7][href]=http%3A%2F%2Fwww.youtube.com%2Foembed%3Furl%3Dhttp%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253Da1hRe_xGuGw%26format%3Dxml&attachment[params][links][7][title]=Devon%20ke%20Dev%20Mahadev%2010th%20July%202012%20Video%20Watch%20Online%20Pt4&attachment[params][links][8][id]=www-core-css&attachment[params][links][8][rel]=stylesheet&attachment[params][links][8][href]=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fcssbin%2Fwww-core-vflMJW9Qx.css&attachment[params][links][9][itemprop]=url&attachment[params][links][9][href]=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da1hRe_xGuGw&attachment[params][links][10][itemprop]=url&attachment[params][links][10][href]=http%3A%2F%2Fwww.youtube.com%2Fchannel%2FUCpEMCp-RW4JB0RkTROQDWrg&attachment[params][links][11][itemprop]=url&attachment[params][links][11][href]=https%3A%2F%2Fplus.google.com%2F101628430301028857728&attachment[params][links][12][itemprop]=thumbnailUrl&attachment[params][links][12][href]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fhqdefault.jpg&attachment[params][links][13][itemprop]=url&attachment[params][links][13][href]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fmqdefault.jpg&attachment[params][links][14][itemprop]=embedURL&attachment[params][links][14][href]=http%3A%2F%2Fwww.youtube.com%2Fv%2Fa1hRe_xGuGw%3Fversion%3D3%26autohide%3D1&attachment[params][images][0]=http%3A%2F%2Fi2.ytimg.com%2Fvi%2Fa1hRe_xGuGw%2Fmqdefault.jpg&attachment[params][cache_hit]=1&attachment[type]=100&uithumbpager_width=320&uithumbpager_height=180&composertags_place=&composertags_place_name=&composer_predicted_city=&composer_session_id=1342159698&is_explicit_place=&composertags_city=&disable_location_sharing=false&nctr[_mod]=pagelet_timeline_recent&__user=100003798185175&__a=1&phstamp=16581665477831159710600
                                        string strResponse = string.Empty;
                                        try
                                        {
                                            strResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.GroupsGroupCampaignManagerPostAjaxUpdateStatusUrl), strPostData);

                                            if (strResponse.Contains("errorSummary"))
                                            {
                                                try
                                                {
                                                    string attachment_params_urlInfo_final = string.Empty;
                                                    string attachment_params_favicon = string.Empty;
                                                    string link_metrics_base_domain = string.Empty;

                                                    attachment_params_favicon = Utils.getBetween(res_post_GetImageParams, "attachment[params][favicon]", "\\/>").Replace(" value=", "").Replace("\\\"", "").Replace("\\", "");

                                                    attachment_params_urlInfo_final = Utils.getBetween(res_post_GetImageParams, "attachment[params][urlInfo][final]", "\\/>").Replace(" value=", "").Replace("\\\"", "").Replace("\\", "");

                                                    link_metrics_base_domain = Utils.getBetween(res_post_GetImageParams, "link_metrics[base_domain]", "\\/>").Replace(" value=", "").Replace("\\\"", "").Replace("\\", "");

                                                    string PostDataa = "composer_session_id=f461bebd-0d21-4555-a46f-81020df04023&fb_dtsg=" + fb_dtsg + "&xhpc_context=profile&xhpc_ismeta=1&xhpc_timeline=1&xhpc_composerid=" + xhpc_composerid + "&xhpc_targetid=" + xhpc_targetid + "&clp=%7B%22cl_impid%22%3A%22bd5578f5%22%2C%22clearcounter%22%3A0%2C%22elementid%22%3A%22u_0_39%22%2C%22version%22%3A%22x%22%2C%22parent_fbid%22%3A693901727326724%7D&xhpc_message_text=" + xhpc_message_text + "%20&xhpc_message=" + xhpc_message + "%20&aktion=post&app_id=2309869772&attachment[params][urlInfo][canonical]=" + attachment_params_urlInfo_final + "&attachment[params][urlInfo][final]=" + attachment_params_urlInfo_final + "&attachment[params][urlInfo][user]=" + attachment_params_urlInfo_final + "&attachment[params][favicon]=" + attachment_params_favicon + "&attachment[params][title]=" + link_metrics_base_domain + "&attachment[params][summary]=" + attachment_params_summary + "&attachment[params][images][0]=" + attachment_params_images + "&attachment[params][medium]=106&attachment[params][url]=http%3A%2F%2Fwww.google.com%2F&attachment[type]=100&link_metrics[source]=ShareStageExternal&link_metrics[domain]=www.google.com&link_metrics[base_domain]=google.com&link_metrics[title_len]=6&link_metrics[summary_len]=159&link_metrics[min_dimensions][0]=70&link_metrics[min_dimensions][1]=70&link_metrics[images_with_dimensions]=2&link_metrics[images_pending]=0&link_metrics[images_fetched]=0&link_metrics[image_dimensions][0]=269&link_metrics[image_dimensions][1]=95&link_metrics[images_selected]=2&link_metrics[images_considered]=2&link_metrics[images_cap]=3&link_metrics[images_type]=ranked&composer_metrics[best_image_w]=100&composer_metrics[best_image_h]=100&composer_metrics[image_selected]=0&composer_metrics[images_provided]=2&composer_metrics[images_loaded]=2&composer_metrics[images_shown]=2&composer_metrics[load_duration]=2&composer_metrics[timed_out]=0&composer_metrics[sort_order]=&composer_metrics[selector_type]=UIThumbPager_6&scheduled=0&backdated_date[year]=&backdated_date[month]=&backdated_date[day]=&future_dateIntlDisplay=28%2F3%2F2014&future_date=3%2F28%2F2014&future_time=&future_time_display_time=&is_explicit_place=&composertags_place=&composertags_place_name=&tagger_session_id=1395899372&composertags_city=&disable_location_sharing=false&composer_predicted_city=&UITargetedPrivacyWidget=80&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=7n8ajEAMCBynxl2u6aEyx9CxSq78hAKGgyiGGfJ4WpUpBw&__req=8&ttstamp=2658166727510250104&__rev=1179995";

                                                    strResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.GroupsGroupCampaignManagerPostAjaxUpdateStatusUrl), PostDataa);    // "https://www.facebook.com/ajax/updatestatus.php"
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }

                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        try
                                        {
                                            if (string.IsNullOrEmpty(strResponse))
                                            {
                                                try
                                                {
                                                    strResponse = HttpHelper.postFormData(new Uri(faceboardpro.FBGlobals.Instance.PageFanPageUrlComposerPhpUrl), strPostData);
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }

                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        if (strResponse.Contains("\"errorSummary\":"))
                                        {
                                            try
                                            {
                                                string summary = GlobusHttpHelper.ParseJson(strResponse, "errorSummary");
                                                string errorDescription = GlobusHttpHelper.ParseJson(strResponse, "errorDescription");

                                                GlobusLogHelper.log.Info("Fan Page Posting Error: " + summary + " | Error Description: " + errorDescription);

                                                if (summary.Contains("Please verify your account"))
                                                {
                                                    return;
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        if (!strResponse.Contains("error"))
                                        {
                                            //string ok = "ok";
                                            // TotalFanPageWallPoster_Counter++;
                                            GlobusLogHelper.log.Info(CountPostWall + " Wall Posted With Image URL : " + xhpc_message_text + " On The Fan Page URL : " + strFanPageURL + " With User Name : " + Userss);
                                            CountPostWall++;

                                            // Write Data in CSV File  
                                            //  CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, _ExportLocation);                                    

                                            try
                                            {
                                                string CSVHeader = "UserName" + "," + "FanpageUrl" + "," + "Message";
                                                string CSV_Content = Username + "," + lstFanPageURLsitem + "," + xhpc_message_text;

                                                Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, GlobusFileHelper.DesktopFanFilePath);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }

                                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Couldn't Wall Post With Image URL : " + xhpc_message_text + " On The Fan Page URL : " + strFanPageURL + " With User Name : " + Userss);
                                            GlobusLogHelper.log.Debug("Couldn't Wall Post With Image URL : " + xhpc_message_text + " On The Fan Page URL : " + strFanPageURL + " With User Name : " + Userss);
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error >>> ex.Message >>> " + ex.Message + " ex.StackTrace >>> " + ex.StackTrace + " With Username >>> " + Userss);
                            //GlobusLogHelper.log.Debug("Error >>> ex.Message >>> " + ex.Message + " ex.StackTrace >>> " + ex.StackTrace + " With Username >>> " + Userss);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error >>> ex.Message >>> " + ex.Message + " ex.StackTrace >>> " + ex.StackTrace + " With Username >>> " + fbUser.username);
                // GlobusLogHelper.log.Debug("Error >>> ex.Message >>> " + ex.Message + " ex.StackTrace >>> " + ex.StackTrace + " With Username >>> " + fbUser.username);
            }

            GlobusLogHelper.log.Info("Process Completed Of Wall Posting With Username >>> " + fbUser.username);
            GlobusLogHelper.log.Debug("Process Completed Of Wall Posting With Username >>> " + fbUser.username);

        }
예제 #11
0
        public void StartImageUploading(ref FacebookUser fbUser, string url)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

            string strUserName = fbUser.username;
            string strProxyAddress = fbUser.proxyusername;
            string strProxyUserName = fbUser.proxyusername;
            string strProxyPassword = fbUser.proxypassword;
            string strProxyPort = fbUser.proxyport;            

            try
            {
                 GlobusLogHelper.log.Debug(" Starting Image Upload With Username : "******" On The URL : " + url);
                 GlobusLogHelper.log.Info(" Starting Image Upload With Username : "******" On The URL : " + url);

                string pics = string.Empty;
                string message = string.Empty;
                string pageId = string.Empty;
                string session_id = string.Empty;

                if (string.IsNullOrEmpty(strProxyPort))
                {
                    strProxyPort = "80";
                }

                string res_Home = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));     //"https://www.facebook.com/"

                string __user = GlobusHttpHelper.GetParamValue(res_Home, "user");
                if (string.IsNullOrEmpty(__user))
                {
                    __user = GlobusHttpHelper.ParseJson(res_Home, "user");
                }              

                string fb_dtsg = Get_fb_dtsg(res_Home);

                string res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(url));

                if (res_get_FanPage.Contains("?page_id="))
                {
                    pageId = res_get_FanPage.Substring(res_get_FanPage.IndexOf("?page_id="), res_get_FanPage.IndexOf("\"", res_get_FanPage.IndexOf("?page_id=")) - res_get_FanPage.IndexOf("?page_id=")).Replace("?page_id=", string.Empty).Replace("\"", string.Empty).Trim();
                }

                res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerPagesGetting + pageId + ""));  


                string postURL_identity = FBGlobals.Instance.PageManagerPageIdentitySwitchPhp;                                    
                string postData_identity = "fb_dtsg=" + fb_dtsg + "&user_id=" + pageId + "&url=" + Uri.EscapeUriString(url) + "";

                res_get_FanPage = HttpHelper.postFormData(new Uri(postURL_identity), postData_identity);

                string composerid = GlobusHttpHelper.GetParamValue(res_get_FanPage, "composerid");
                if (string.IsNullOrEmpty(composerid))
                {
                    composerid = GlobusHttpHelper.ParseJson(res_get_FanPage, "composerid");
                }

                string targetid = GlobusHttpHelper.GetParamValue(res_get_FanPage, "targetid");
                if (string.IsNullOrEmpty(targetid))
                {
                    targetid = GlobusHttpHelper.ParseJson(res_get_FanPage, "targetid");
                }

                #region for
                for (int i = 0; i < noOfPicsPerURL; i++)
                {
                    try
                    {

                        if (picsCounter < lstPicturecollectionPostPicOnFanPageWall.Count)
                        {
                            pics = lstPicturecollectionPostPicOnFanPageWall[picsCounter];
                            picsCounter++;
                        }
                        else
                        {
                             GlobusLogHelper.log.Debug("All pics used up : " + strUserName);
                             GlobusLogHelper.log.Info("All pics used up : " + strUserName);
                            return;
                        }


                        if (lstFanPageCollectionFanPagePosterMessage.Count > 0)
                        {
                            message = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
                        }

                        ///composer hash1
                        string postURL_composerhash1 = FBGlobals.Instance.PageManagerPageAjaxComposerx1;    
                        string postData_composerhash1 = "fb_dtsg=" + fb_dtsg + "&composerid=" + composerid + "&targetid=" + targetid + "&istimeline=1&composercontext=composer&loaded_components[0]=maininput&loaded_components[1]=backdateicon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=backdateicon&loaded_components[5]=mainprivacywidget&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=7n8ahyj35whVag&__req=4&phstamp=1658167108458977122472";

                        string res_post_composerhash1 = HttpHelper.postFormData(new Uri(postURL_composerhash1), postData_composerhash1);


                        ///composer hash2
                        ///
                        string postURL_composerhash2 = FBGlobals.Instance.PageManagerPageAjaxComposerx2;     
                        string postData_composerhash2 = "fb_dtsg=" + fb_dtsg + "&composerid=" + composerid + "&targetid=" + targetid + "&istimeline=1&composercontext=composer&loaded_components[0]=maininput&loaded_components[1]=backdateicon&loaded_components[2]=placetaggericon&loaded_components[3]=mainprivacywidget&loaded_components[4]=backdateicon&loaded_components[5]=mainprivacywidget&loaded_components[6]=placetaggericon&loaded_components[7]=maininput&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=7n88QoAMNo4uiA&__req=5&phstamp=1658167108458977122472";

                        string res_post_composerhash2 = HttpHelper.postFormData(new Uri(postURL_composerhash2), postData_composerhash2);

                        if (res_post_composerhash2.Contains("{\"session_id\":"))
                        {
                            try
                            {
                                session_id = res_post_composerhash2.Substring(res_post_composerhash2.IndexOf("{\"session_id\":"), res_post_composerhash2.IndexOf("}", res_post_composerhash2.IndexOf("{\"session_id\":")) - res_post_composerhash2.IndexOf("{\"session_id\":")).Replace("{\"session_id\":", string.Empty).Replace("\"", string.Empty).Trim();
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                        }

                        NameValueCollection nvc = new NameValueCollection();
                        nvc.Add("xhpc_context", "profile");
                        nvc.Add("fb_dtsg", fb_dtsg);
                        //nvc.Add("id", userId);
                        nvc.Add("xhpc_ismeta", "1");
                        nvc.Add("xhpc_timeline", "1");
                        nvc.Add("xhpc_composerid", composerid);
                        nvc.Add("xhpc_targetid", targetid);
                        nvc.Add("xhpc_message_text", message);
                        nvc.Add("xhpc_message", message);
                        //nvc.Add("xhpc_message_text", "profile");
                        nvc.Add("type", "1");
                        nvc.Add("oid", "");
                        nvc.Add("application", "composer");
                        nvc.Add("scheduled", "0");
                        nvc.Add("backdated_date[year]", "");
                        nvc.Add("backdated_date[day]", "");
                        nvc.Add("backdated_date[hour]", "");
                        nvc.Add("backdated_date[minute]", "");
                        nvc.Add("is_explicit_place", "");
                        nvc.Add("composertags_place", "");
                        nvc.Add("composertags_place_name", "");
                        nvc.Add("composer_session_id", session_id);
                        nvc.Add("composertags_city", "");
                        nvc.Add("disable_location_sharing", "false");
                        nvc.Add("composer_predicted_city", "");
                        nvc.Add("UITargetedPrivacyWidget", "80");
                        //nvc.Add("return", "/ajax/timeline/profile_pic_upload.php?pic_type=1&id=" + userId);

                        if (HttpHelper.HttpUploadFile(FBGlobals.Instance.PostPicOnWallPostUploadPhotosUrl + __user + "&__a=1&__dyn=7n88QoAMNo4uiA&__req=7&fb_dtsg=" + fb_dtsg + "", pics, "pic", "image/jpeg", nvc, strProxyAddress, 80, strProxyUserName, strProxyPassword))          //  "https://upload.facebook.com/media/upload/photos/composer/?__user="******"Image Uploaded With Username : "******" On The URL : " + url);
                            GlobusLogHelper.log.Info("Image Uploaded With Username : "******" On The URL : " + url);
                            try
                              {
                                  int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"UserName" + "," + "FanpageUrl" + "," + "Message";
                                        string CSV_Content = strUserName + "," + url + "," + pics;

                                        Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, GlobusFileHelper.DesktopFanFilePath);
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Debug("Couldn't Image Upload With Username : "******" On The URL : " + url);
                            GlobusLogHelper.log.Info("Couldn't Image Upload With Username : "******" On The URL : " + url);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        GlobusLogHelper.log.Info("Exception class>>  " + "ImageUploader  || Method>>  " + "StartImageUploading   || Exception: " + ex.Message + "    || DateTime: " + DateTime.Now.ToString());

                        if (ex.Message.ToLower().Contains("timed"))
                        {
                            GlobusLogHelper.log.Debug("Operation timed out : " + strUserName);
                            GlobusLogHelper.log.Info("Operation timed out : " + strUserName);

                            res_get_FanPage = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerPagesGetting + pageId + ""));            //  "https://www.facebook.com/pages/getting_started?page_id="
                            postURL_identity = FBGlobals.Instance.PageManagerPageIdentitySwitchPhp;                                                     // "https://www.facebook.com/identity_switch.php"
                            postData_identity = "fb_dtsg=" + fb_dtsg + "&user_id=" + pageId + "&url=" + Uri.EscapeUriString(url) + "";
                            res_get_FanPage = HttpHelper.postFormData(new Uri(postURL_identity), postData_identity);
                        }
                    }
                }

#endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
                GlobusLogHelper.log.Error("Exception class>>  " + "ImageUploader  || Method>>  " + "StartImageUploading   || Exception: " + ex.Message + "    || DateTime: " + DateTime.Now.ToString());
            }

            GlobusLogHelper.log.Debug(" Process Completed Image Upload With Username : "******" On The URL : " + url);
            GlobusLogHelper.log.Info(" Process Completed Image Upload With Username : "******" On The URL : " + url);
        }
예제 #12
0
 private void StartActionFanPagePoster(ref FacebookUser fbUser)
 {           
     try
     {
        if (StartProcessUsingFanPagePoster == "Post Urls")
        {
           PostOnFanPageWallWithURLAndItsImage(ref fbUser);
        }
        else if (StartProcessUsingFanPagePoster == "Post Simple Message")
        {
            if (isPostMessageWithUrl)
            {
                PostOnFanPageWallWithURLAndItsImage(ref fbUser);
            }
            else
            {
                PostFanPageMessageUsingUrls(ref fbUser);
            }
            GlobusLogHelper.log.Info("Process completed With : " + fbUser.username);
            GlobusLogHelper.log.Debug("Process completed With : " + fbUser.username);
        }
        else if (StartProcessUsingFanPagePoster == "Post Picture On Own Page ")
        {
            UploadImage(ref fbUser);
        }
        else if (StartProcessUsingFanPagePoster == "Post Picture On Fan Page")
        {
            UploadImageOnPage(ref fbUser);
        }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }
예제 #13
0
        public void OneToOneCommentOnPostsUrl(ref FacebookUser fbUser)
        {
            string Username = fbUser.username;
            string Password = fbUser.password;

            try
            {
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
                GlobusLogHelper.log.Info("Please Wait....");
                GlobusLogHelper.log.Debug("Please Wait...");
                string UserId=string.Empty;
                string fb_dtsg = string.Empty;
                try
                {
                  string HomePageSrc=HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/"));
                  UserId=Utils.getBetween(HomePageSrc,"\"USER_ID\":\"","\"");
                  fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(HomePageSrc);
                }
                catch(Exception ex)
                {
                }
                if (QueuePostUrls.Count != 0)
                {
                    string PostUrl = QueuePostUrls.Dequeue();
                    string PostResp = HttpHelper.getHtmlfromUrl(new Uri(PostUrl));
                    string[] containerData = Regex.Split(PostResp,"uiUfi UFIContainer");
                    string containerID = string.Empty;
                    containerID = Utils.getBetween(containerData[1], "id=\"", "\"");
                   
                    string PostId = string.Empty;
                    if (PostUrl.Contains("posts"))
                    {
                        string[] postData = Regex.Split(PostUrl, "/");
                        PostId = postData[postData.Length - 1];
                    }
                    else if (PostUrl.Contains("fbid"))
                    {
                        PostId = Utils.getBetween(PostUrl, "fbid=", "&");
                    }
                    else if(string.IsNullOrEmpty(PostId))
                    {
                       string[] postData=Regex.Split(PostUrl,"/");
                        PostId = postData[postData.Length - 2];
                    }

                    string message = string.Empty;
                    if (QueueMessages.Count != 0)
                    {
                        message = QueueMessages.Dequeue();
                    }
                    else
                    {
                        message = lstMessageCollectionCommentLiker[new Random().Next(0, lstMessageCollectionCommentLiker.Count - 1)];
                    }
                    string PostCommentUrl = "https://www.facebook.com/ajax/ufi/add_comment.php";
                    string CommentData = "ft_ent_identifier=" + PostId + "&comment_text=" + message + "&source=2&client_id=1419601165176%3A2502448833&reply_fbid&parent_comment_id&rootid=" + containerID + "&clp=&attached_sticker_fbid=0&attached_photo_fbid=0&&&ft[tn]=[]&av=" + UserId + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyG8EihUtCxO4p9GgSmEZ9LFwxBxCbzElx2ubhHximmey8OdUS8zU&__req=l&fb_dtsg="+fb_dtsg+"&ttstamp=265817253854997122907682122&__rev=1543964";
                    string CommentResp = string.Empty;
                    try
                    {
                        CommentResp = HttpHelper.postFormData(new Uri(PostCommentUrl), CommentData);
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(ex.Message);
                    }
                    if (CommentResp.Contains("CommentAddedActive"))
                    {
                        GlobusLogHelper.log.Info("Commented On Post Id=" + PostId + " With User ="******" Message=" + message + "");
                    }
                    else
                    {
                        GlobusLogHelper.log.Info("Sorry !! Unable To Comment On Post Id=" + PostId + " With User ="******" Message=" + message + "");                    
                    }

                }
                else
                {
                    GlobusLogHelper.log.Info("Process Completed With Commenting On Post ");
                }

                int Delay = new Random().Next(minDelayFanPagePoster, maxDelayFanPagePoster);
                GlobusLogHelper.log.Info("Delaying For "+Delay+" Seconds");
                Thread.Sleep(Delay * 1000);

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(ex.Message);
            }
        }
예제 #14
0
 private void StartActionOneToOneComment(ref FacebookUser fbUser)
 {            
     try
     {
         foreach (string PostUrl in lstFanPageUrlCollectionCommentLiker)
         {
             QueuePostUrls.Enqueue(PostUrl);
         }
         foreach (string itemMsg in lstMessageCollectionCommentLiker)
         {
             QueueMessages.Enqueue(itemMsg);
         }
         OneToOneCommentOnPostsUrl(ref fbUser);
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error(ex.Message);
     }
 }
예제 #15
0
        private void StartActionWebSiteLiker(ref FacebookUser fbUser)
        {
            try
            {
                //  WebSiteLiker method

                WebsiteLiker(ref fbUser);

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #16
0
        //noOfPicsPerURL   ajay k yadav 18/11/2013

        public void PostFanPageMessageUsingUrls(ref FacebookUser fbUser)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
               
                #region Post variable

                string post_form_id = string.Empty;
                string fbpage_id = string.Empty;
                string fb_dtsg = string.Empty;
                string __user = string.Empty;
                string xhpc_composerid = string.Empty;
                string xhpc_targetid = string.Empty;
                string message_text = string.Empty;
                string xhpc_composerid12 = string.Empty;
                bool isPosted = false;
                bool isPostingAvailbale = false;
                #endregion

                int NoOfEmailAccount = 20;              
                Array paramArray = new object[8];              
                string  Username = fbUser.username;
                string  Password = fbUser.password;
                string proxyAddress =fbUser.proxyusername;
                string proxyPort =fbUser.proxyport;
                string proxyUserName =fbUser.proxyusername;
                string proxyPassword =fbUser.proxypassword;
                string strPostFanpageMessageCount = string.Empty; 
                string Message =string.Empty;
                string campaignName = string.Empty;    
                string ResponseFanPagePostMessage = string.Empty;
              

                foreach (var FanPageUrl in lstFanPageUrlCollectionFanPagePoster)
                {
                    count = 0;

                    while (true)
                    {
                        try
                        {
                            message_text = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        try
                        {

                            string PageSrcFanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanPageUrl));
                            if (count >=noOfPicsPerURL)
                            {
                                break;
                            }

                            GlobusLogHelper.log.Debug("Posting Message : " + message_text + " With UserName : "******"Fan Page Link : " + FanPageUrl);
                            if (PageSrcFanPageUrl.Contains("fb_dtsg"))
                            {
                                string strfb_dtsg = GlobusHttpHelper.GetParamValue(PageSrcFanPageUrl, "fb_dtsg");
                                if (string.IsNullOrEmpty(strfb_dtsg))
                                {
                                    strfb_dtsg = GlobusHttpHelper.ParseJson(PageSrcFanPageUrl, "fb_dtsg");
                                }
                            }

                            string strFanPageURL = FanPageUrl;

                            __user = GlobusHttpHelper.Get_UserID(PageSrcFanPageUrl);

                            fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(PageSrcFanPageUrl);

                            fbpage_id = GlobusHttpHelper.GetPageID(PageSrcFanPageUrl, ref strFanPageURL);
                           
                            /*Enable this if User want to post Message with like the Fan Page */
                          /*  string postURL_1st = FaceDominator.FBGlobals.Instance.pageFanPagePosterAjaxPagesFanStatusPhp;   
                            string postData_1st = "fbpage_id=" + fbpage_id + "&add=true&reload=false&fan_origin=page_timeline&nctr[_mod]=pagelet_timeline_page_actions&fb_dtsg=" + fb_dtsg + "&__user="******"&phstamp=" + GenerateTimeStamp() + "";
                            string res_post_1st = HttpHelper.postFormData(new Uri(postURL_1st), postData_1st);

                            if (res_post_1st.Contains("Security Check Required"))
                            {
                                string content = Username + ":" + Password;
                                GlobusLogHelper.log.Debug("Security Check Required : " + FanPageUrl + "  with : " + Username);
                                GlobusLogHelper.log.Info("Security Check Required : " + FanPageUrl + "  with : " + Username);
                                continue;
                            }
                            else if (res_post_1st.Contains("You already like this Page"))
                            {
                                #region commentedCode
                                //string content = Username + ":" + Password;
                                //CreateFileLikeDeskTop(content, "UnLike");
                                //GlobusLogHelper.log.Debug("Already Liked " + FanPageUrl + "  with " + Username);
                                //return; 
                                #endregion

                                GlobusLogHelper.log.Debug("You have already liked this Page : " + FanPageUrl + "  with : " + Username);
                                GlobusLogHelper.log.Info("You have already liked this Page : " + FanPageUrl + "  with : " + Username);
                            }
                            else if (res_post_1st.Contains("\"errorSummary\""))
                            {
                                try
                                {
                                    string summary = GlobusHttpHelper.ParseJson(res_post_1st, "errorSummary");
                                    string errorDescription = GlobusHttpHelper.ParseJson(res_post_1st, "errorDescription");

                                   // GlobusLogHelper.log.Debug("Liking Error: " + summary + " | Error Description: " + errorDescription);
                                   // GlobusLogHelper.log.Info("Liking Error: " + summary + " | Error Description: " + errorDescription);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error(ex.Message);
                                }
                            }
                            else
                            {
                                GlobusLogHelper.log.Debug("Liked " + FanPageUrl + "  with " + Username);
                                GlobusLogHelper.log.Info("Liked " + FanPageUrl + "  with " + Username);
                            }*/

                            try
                            {
                                string CSVHeader = "UserName" + "," + "FanpageUrl" + "," + "Message";
                                string CSV_Content = Username + "," + FanPageUrl + "," + message_text;

                                Globussoft.GlobusFileHelper.ExportDataCSVFile(CSVHeader, CSV_Content, GlobusFileHelper.DesktopFanFilePath);
                         }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                          

                            string postURL_2nd = faceboardpro.FBGlobals.Instance.pageFanPageAjaxPagesFetchColumnPhp;
                            string postData_2nd = "profile_id=" + fbpage_id + "&tab_key=timeline&fb_dtsg=" + fb_dtsg + "&__user="******"&phstamp=" + GenerateTimeStamp() + "";
                            string res_post_2nd = HttpHelper.postFormData(new Uri(postURL_2nd), postData_2nd);

                            string PageSrcFanPageUrlPost = HttpHelper.getHtmlfromUrl(new Uri(FanPageUrl + "?sk=wall"));
                            message_text = message_text.Replace(" ", "%20");

                            if (PageSrcFanPageUrlPost.Contains("xhpc_composerid"))
                            {
                                try
                                {
                                    xhpc_composerid = PageSrcFanPageUrlPost.Substring(PageSrcFanPageUrlPost.IndexOf("xhpc_composerid"), 200);
                                    string[] Arr = xhpc_composerid.Split('"');
                                    xhpc_composerid = Arr[2];
                                    xhpc_composerid = xhpc_composerid.Replace("\\", "");
                                    xhpc_composerid = xhpc_composerid.Replace("\\", "");
                                    xhpc_composerid = xhpc_composerid.Replace("\\", "");
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            if (PageSrcFanPageUrlPost.Contains("xhpc_targetid"))
                            {
                                string strxhpc_targetid = PageSrcFanPageUrlPost.Substring(PageSrcFanPageUrlPost.IndexOf("xhpc_targetid") + 9, 100);
                                string[] Arrxhpc_targetid = strxhpc_targetid.Split('"');
                                xhpc_targetid = Arrxhpc_targetid[2];
                                xhpc_targetid = xhpc_targetid.Replace("\\", "");
                                //count++;
                                //GlobusLogHelper.log.Debug(count.ToString() + " Posted Message on Fan Page Wall with " + Username + " and " + FanPageUrl);
                                //GlobusLogHelper.log.Info(count.ToString() + " Posted Message on Fan Page Wall with " + Username + " and " + FanPageUrl);
                                
                            }

                            ///Post Message
                         

                            try
                            {
                                message_text = lstFanPageCollectionFanPagePosterMessage[new Random().Next(0, lstFanPageCollectionFanPagePosterMessage.Count)];
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                            if (PageSrcFanPageUrlPost.Contains("Write something on this Page"))
                            {
                                ResponseFanPagePostMessage = HttpHelper.postFormData(new Uri(faceboardpro.FBGlobals.Instance.pageFanPagePosterUpdateStatusPhp), "&fb_dtsg=" + fb_dtsg + "&xhpc_composerid=" + xhpc_composerid + "&xhpc_targetid=" + xhpc_targetid + "&xhpc_context=profile&xhpc_fbx=1&xhpc_timeline=&xhpc_ismeta=&xhpc_message_text=" + message_text + "&xhpc_message=" + message_text + "&nctr[_mod]=pagelet_wall&lsd&post_form_id_source=AsyncRequest&__user="******"Couldn't Update Status") && ResponseFanPagePostMessage.Contains("There was a problem updating your status. Please try again in a few minutes"))
                                {
                                    isPosted = false;
                                    count++;
                                    GlobusLogHelper.log.Debug("you can't post on this wall" + Username + " and " + FanPageUrl);
                                    GlobusLogHelper.log.Info("you can't post on this wall" + Username + " and " + FanPageUrl);
                                    continue;
                                }
                            }
                            else
                            {
                                isPosted = false;
                            
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        try
                        {
                            if (!ResponseFanPagePostMessage.Contains("This status update is identical to the last one you posted") && !string.IsNullOrEmpty(ResponseFanPagePostMessage) && isPosted)
                            {
                                count++;
                                GlobusLogHelper.log.Debug(count.ToString() + " Posted Message on Fan Page Wall with " + Username + " and " + FanPageUrl);
                                GlobusLogHelper.log.Info(count.ToString() + " Posted Message on Fan Page Wall with " + Username + " and " + FanPageUrl);


                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"This status update is identical to the last one you posted"))
                            {
                                
                                GlobusLogHelper.log.Debug("you can't post on this wall" + Username + " and " + FanPageUrl);
                                GlobusLogHelper.log.Info("you can't post on this wall" + Username + " and " + FanPageUrl);


                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Posting Option Not Available On "+ FanPageUrl+" So Message "+message_text+" Can't Be Posted");
                                GlobusLogHelper.log.Info("Posting Option Not Available On " + FanPageUrl + " So Message" + message_text + " Can't Be Posted");
                                break;

                            }
                        }

                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                }
	
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

          //  Thread.Sleep(1000);
        }
예제 #17
0
        public void WebsiteLiker(ref FacebookUser fbUser)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
                try
                {
                    lstThreadsWebSiteLiker.Add(Thread.CurrentThread);
                    lstThreadsWebSiteLiker.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }

                string Comment = string.Empty;
                string Username = string.Empty;
                string Password = string.Empty;
                string UserId = string.Empty;
                List<string> listFriendId = new List<string>();

                GlobusLogHelper.log.Debug("Please Wait ..");
                GlobusLogHelper.log.Info("Please Wait..");

                Array paramArray = new object[10];
                string Userss = fbUser.username;
                string strProxyPort = string.Empty;
                string strProxyAddress = string.Empty;
                string strProxyUserName = string.Empty;
                string strProxyPassword = string.Empty;

                    string webSiteUrl = string.Empty;
                    try
                    {
                        string fb_dtsg = string.Empty;
                        string href = string.Empty;
                        string iframe_referer = string.Empty;
                        string __user = string.Empty;

                        int counter_LikesWithAccount = 0;

                        if (string.IsNullOrEmpty(strProxyPort))
                        {
                            strProxyPort = (0).ToString();
                        }

                        if (lstWebSiteLikerCollectionWebSiteLiker.Count > 0)
                        {
                            try
                            {
                                string fbPageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.facebook.com"), strProxyAddress, Convert.ToInt32(strProxyPort), strProxyUserName, strProxyPassword);
                                string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://developers.facebook.com/docs/reference/plugins/like/"), strProxyAddress, Convert.ToInt32(strProxyPort), strProxyUserName, strProxyPassword);

                              

                                foreach (string item in lstWebSiteLikerCollectionWebSiteLiker)
                                {
                                    try
                                    {
                                        webSiteUrl = item;
                                        if (counter_LikesWithAccount >= noOfLikesPerAccount)
                                        {
                                            GlobusLogHelper.log.Debug("Reached max no of likes : " + noOfLikesPerAccount + " per account with: " + fbUser.username);
                                            GlobusLogHelper.log.Info("Reached max no of likes : " + noOfLikesPerAccount + " per account with: " + fbUser.username);
                                            return;

                                        }

                                        int maxCountOnPage = 3;

                               
                                        string[] webSiteUrlData = Regex.Split(item, "<:>");
                                        if (webSiteUrlData.Length == 2)
                                        {
                                            try
                                            {
                                                webSiteUrl = webSiteUrlData[0];
                                                string requiredCount = webSiteUrlData[1];

                                                if (Utils.IsNumeric(requiredCount))
                                                {
                                                    maxCountOnPage = int.Parse(requiredCount);
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        if (IsCountFullfilled(webSiteUrl, maxCountOnPage))
                                        {
                                             GlobusLogHelper.log.Debug("Required Counts: " + maxCountOnPage + " sent to : " + webSiteUrl);
                                             GlobusLogHelper.log.Info("Required Counts: " + maxCountOnPage + " sent to : " + webSiteUrl);

                                            continue;
                                        }

                                        GlobusLogHelper.log.Debug("Start Liking The Website URL : " + item + " With User Name : " + fbUser.username);
                                        GlobusLogHelper.log.Info("Start Liking The Website URL : " + item + " With User Name : " + fbUser.username);
                                        __user = GlobusHttpHelper.Get_UserID(fbPageSource);
                                        if (string.IsNullOrEmpty(__user))
                                        {
                                            __user = GlobusHttpHelper.ParseJson(fbPageSource, "user");
                                        }


                                        fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(fbPageSource);


                                        bool Statusliked = false;
                                        string app_Key = string.Empty;
                                        try
                                        {
                                            app_Key = Utils.getBetween(pageSource, "appId\\\":", ",\\");
                                            if (string.IsNullOrEmpty(app_Key))
                                            {
                                                app_Key = pageSource.Substring(pageSource.IndexOf("\"appId\":"), pageSource.IndexOf(",", pageSource.IndexOf("\"appId\":")) - pageSource.IndexOf("\"appId\":")).Replace("\"appId\":", string.Empty).Trim();
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        string referer1 = "https://www.facebook.com/plugins/like.php?api_key="+app_Key+"&locale=en_US&sdk=joey&channel_url=https%3A%2F%2Fs-static.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D18%23cb%3Df2c93cc8b01cb7c%26origin%3Dhttps%253A%252F%252Fdevelopers.facebook.com%252Ffa7556e1237aa2%26domain%3Ddevelopers.facebook.com%26relation%3Dparent.parent&href=http%3A%2F%2Fstackoverflow.com%2F&node_type=link&width=450&layout=standard&colorscheme=light&show_faces=true&send=true&extended_social_context=false";

                                       
                                       

                                        string postData = "fb_dtsg=" + fb_dtsg + "&href=" + System.Uri.EscapeDataString(webSiteUrl) + "&action=like&nobootload=&iframe_referer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike%2F&ref=&__user="******"&__a=1&__req=1&phstamp=1658165117561225699218";//"fb_dtsg=AQAu8z8c&href=http%3A%2F%2Fstackoverflow.com%2F&action=like&nobootload=&iframe_referer=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike%2F&ref=&__user=100000570903647&__a=1&__req=1&phstamp=1658165117561225699213";
                                       

                                        string response = HttpHelper.postFormData(new Uri("https://www.facebook.com/plugins/like/connect"), postData, referer1);

                                        string PostDataForCOmment = "fb_dtsg=" + fb_dtsg + "&href=" + System.Uri.EscapeDataString(webSiteUrl) + "&ref=&nobootload=&action=like&comment_text=" + Comment + "&comment=" + Comment + "&__user="******"&__a=1&__dyn=7wfGbx6m5FuC0DU98nxG2y&__req=4&locale=en_US&ttstamp=26581724910189671155011111982&__rev=1528811";
                                        string PostUrlForComment = "https://www.facebook.com/plugins/like/comment";
                                        string ResponceForComment = HttpHelper.postFormData(new Uri(PostUrlForComment), PostDataForCOmment, referer1);



                                        try
                                        {
                                            Comment = lstWebSiteLikerCollectionMessages[Utils.GenerateRandom(0, Convert.ToInt32(lstWebSiteLikerCollectionMessages.Count() - 1))];
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        if (response.Contains("Confirm"))
                                        {
                                            try
                                            {
                                                if (pageSource.Contains("\"appId\":"))
                                                {
                                                     GlobusLogHelper.log.Debug("Liking Require Confirmation With Website >>> " + webSiteUrl + " !");
                                                     GlobusLogHelper.log.Info("Liking Require Confirmation With Website >>> " + webSiteUrl + " !");


                                                    string geturl = "http://www.facebook.com/plugins/error/confirm/like?iframe_referer=http%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike%2F&secure=false&plugin=like&return_params=%7B%22api_key%22%3A%22113869198637480%22%2C%22locale%22%3A%22en_US%22%2C%22sdk%22%3A%22joey%22%2C%22channel_url%22%3A%22http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D18%23cb%3Df3b923da1046022%26origin%3Dhttp%253A%252F%252Fdevelopers.facebook.com%252Ff334b25e7dd67e4%26domain%3Ddevelopers.facebook.com%26relation%3Dparent.parent%22%2C%22href%22%3A%22" + Uri.EscapeDataString(webSiteUrl) + "%2F%22%2C%22node_type%22%3A%22link%22%2C%22width%22%3A%22450%22%2C%22layout%22%3A%22standard%22%2C%22colorscheme%22%3A%22light%22%2C%22show_faces%22%3A%22true%22%2C%22send%22%3A%22true%22%2C%22extended_social_context%22%3A%22false%22%2C%22ret%22%3A%22sentry%22%2C%22act%22%3A%22connect%22%7D";

                                                    string getRequest1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/plugins/error/confirm/like?iframe_referer=http%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Freference%2Fplugins%2Flike%2F&secure=false&plugin=like&return_params=%7B%22api_key%22%3A%22113869198637480%22%2C%22locale%22%3A%22en_US%22%2C%22sdk%22%3A%22joey%22%2C%22channel_url%22%3A%22http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D18%23cb%3Df3b923da1046022%26origin%3Dhttp%253A%252F%252Fdevelopers.facebook.com%252Ff334b25e7dd67e4%26domain%3Ddevelopers.facebook.com%26relation%3Dparent.parent%22%2C%22href%22%3A%22" + Uri.EscapeDataString(webSiteUrl) + "%2F%22%2C%22node_type%22%3A%22link%22%2C%22width%22%3A%22450%22%2C%22layout%22%3A%22standard%22%2C%22colorscheme%22%3A%22light%22%2C%22show_faces%22%3A%22true%22%2C%22send%22%3A%22true%22%2C%22extended_social_context%22%3A%22false%22%2C%22ret%22%3A%22sentry%22%2C%22act%22%3A%22connect%22%7D"));

                                                    string[] Iframerefere1 = System.Text.RegularExpressions.Regex.Split(getRequest1, "iframe_referer");

                                                    string iframe = string.Empty;
                                                    if (Iframerefere1.Length > 2)
                                                    {
                                                        iframe = Iframerefere1[1].Substring(Iframerefere1[1].IndexOf("http"), Iframerefere1[1].IndexOf("/>", Iframerefere1[2].IndexOf("http")) - Iframerefere1[1].IndexOf("http")).Replace(" ", string.Empty).Replace("\\\"", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim().Replace("amp;_fb_noscript1", string.Empty).Replace("amp;", string.Empty).Replace("&_fb_noscript=1", string.Empty);
                                                    }

                                                    string postData1 = "fb_dtsg=" + fb_dtsg + "&iframe_referer=" + iframe;

                                                    string referer = "http://www.facebook.com/plugins/error/confirm/like?iframe_referer=http%3A%2F%2Fwww.facebook.com%2Fplugins%2Flike.php%3Fapi_key%3D113869198637480%26locale%3Den_US%26sdk%3Djoey%26channel_url%3Dhttp%253A%252F%252Fstatic.ak.facebook.com%252Fconnect%252Fxd_arbiter.php%253Fversion%253D18%2523cb%253Df3a615924c2a814%2526origin%253Dhttp%25253A%25252F%25252Fdevelopers.facebook.com%25252Ff3e51ff5a1ad31a%2526domain%253Ddevelopers.facebook.com%2526relation%253Dparent.parent%26href%3Dhttp%253A%252F%252Fhowisaggressivedogbehavior.tumblr.com%252F%26node_type%3Dlink%26width%3D450%26layout%3Dstandard%26colorscheme%3Dlight%26show_faces%3Dtrue%26send%3Dtrue%26extended_social_context%3Dfalse&secure=false&plugin=like&return_params=%7B%22api_key%22%3A%22113869198637480%22%2C%22locale%22%3A%22en_US%22%2C%22sdk%22%3A%22joey%22%2C%22channel_url%22%3A%22http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D18%23cb%3Df3a615924c2a814%26origin%3Dhttp%253A%252F%252Fdevelopers.facebook.com%252Ff3e51ff5a1ad31a%26domain%3Ddevelopers.facebook.com%26relation%3Dparent.parent%22%2C%22href%22%3A%22http%3A%2F%2Fhowisaggressivedogbehavior.tumblr.com%2F%22%2C%22node_type%22%3A%22link%22%2C%22width%22%3A%22450%22%2C%22layout%22%3A%22standard%22%2C%22colorscheme%22%3A%22light%22%2C%22show_faces%22%3A%22true%22%2C%22send%22%3A%22true%22%2C%22extended_social_context%22%3A%22false%22%2C%22ret%22%3A%22sentry%22%2C%22act%22%3A%22connect%22%7DCookie: datr=i4wCUYOslQ-VFRRXTvP4WWny; fr=03Lqn7n9uxeTAg8ms.AWXpEnhoyDogxPI5YkZtw4ZN-Bk.BRC5zb.vf.AWWLzUJk; lu=RgiBynAiO_6mcfxX2Ta8oC9g; locale=en_US; c_user=100003330902438; xs=65%3AMKu1xjd7c90bRQ%3A0%3A1360218145; wd=484x319; act=1360218268354%2F1%3A2; _e_0vG8_0=%5B%220vG8%22%2C1360218268355%2C%22act%22%2C1360218268354%2C1%2C%22http%3A%2F%2Fwww.facebook.com%2Fplugins%2Ferror%2Fconfirm%2Flike%22%2C%22form%22%2C%22submit%22%2C%22-%22%2C%22r%22%2C%22%2Fplugins%2Ferror%2Fconfirm%2Flike%3Fiframe_referer%3Dhttp%253A%252F%252Fwww.facebook.com%252Fplugins%252Flike.php%253Fapi_key%253D113869198637480%2526locale%253Den_US%2526sdk%253Djoey%2526channel_url%253Dhttp%25253A%25252F%25252Fstatic.ak.facebook.com%25252Fconnect%25252Fxd_arbiter.php%25253Fversion%25253D18%252523cb%25253Df3a615924c2a814%252526origin%25253Dhttp%2525253A%2525252F%2525252Fdevelopers.facebook.com%2525252Ff3e51ff5a1ad31a%252526domain%25253Ddevelopers.facebook.com%252526relation%25253Dparent.parent%2526href%253Dhttp%25253A%25252F%25252Fhowisaggressivedogbehavior.tumblr.com%25252F%2526node_type%253Dlink%2526width%253D450%2526layout%253Dstandard%2526colorscheme%253Dlight%2526show_faces%253Dtrue%2526send%253Dtrue%2526extended_social_context%253Dfalse%26secure%3Dfalse%26plugin%3Dlike%26return_params%3D%257B%2522api_key%2522%253A%2522113869198637480%2522%252C%2522locale%2522%253A%2522en_US%2522%252C%2522sdk%2522%253A%2522joey%2522%252C%2522channel_url%2522%253A%2522http%253A%252F%252Fstatic.ak.facebook.com%252Fconnect%252Fxd_arbiter.php%253Fversion%253D18%2523cb%253Df3a615924c2a814%2526origin%253Dhttp%25253A%25252F%25252Fdevelopers.facebook.com%25252Ff3e51ff5a1ad31a%2526domain%253Ddevelopers.facebook.com%2526relation%253Dparent.parent%2522%252C%2522href%2522%253A%2522http%253A%252F%252Fhowisaggressivedogbehavior.tumblr.com%252F%2522%252C%2522node_type%2522%253A%2522link%2522%252C%2522width%2522%253A%2522450%2522%252C%2522layout%2522%253A%2522standard%2522%252C%2522colorscheme%2522%253A%2522light%2522%252C%2522show_faces%2522%253A%2522true%2522%252C%2522send%2522%253A%2522true%2522%252C%2522extended_social_context%2522%253A%2522false%2522%252C%2522ret%2522%253A%2522sentry%2522%252C%2522act%2522%253A%2522connect%2522%257D%22%2C%7B%22ft%22%3A%7B%7D%2C%22gt%22%3A%7B%7D%7D%2C0%2C0%2C0%2C0%2C16%5D" + app_Key + "%26locale%3Den_US%26sdk%3Djoey%26channel_url%3Dhttp%253A%252F%252Fstatic.ak.facebook.com%252Fconnect%252Fxd_arbiter.php%253Fversion%253D18%2523cb%253Df394609fd48f4f8%2526origin%253Dhttp%25253A%25252F%25252Fdevelopers.facebook.com%25252Ff334b25e7dd67e4%2526domain%253Ddevelopers.facebook.com%2526relation%253Dparent.parent%26href%3Dhttp%253A%252F%252Fneronsolutions.co.uk%252F%26node_type%3Dlink%26width%3D450%26layout%3Dstandard%26colorscheme%3Dlight%26show_faces%3Dtrue%26send%3Dtrue%26extended_social_context%3Dfalse&secure=false&plugin=like&return_params=%7B%22api_key%22%3A%22" + app_Key + "%22%2C%22locale%22%3A%22en_US%22%2C%22sdk%22%3A%22joey%22%2C%22channel_url%22%3A%22http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D18%23cb%3Df394609fd48f4f8%26origin%3Dhttp%253A%252F%252Fdevelopers.facebook.com%252Ff334b25e7dd67e4%26domain%3Ddevelopers.facebook.com%26relation%3Dparent.parent%22%2C%22href%22%3A%22http%3A%2F%2Fneronsolutions.co.uk%2F%22%2C%22node_type%22%3A%22link%22%2C%22width%22%3A%22450%22%2C%22layout%22%3A%22standard%22%2C%22colorscheme%22%3A%22light%22%2C%22show_faces%22%3A%22true%22%2C%22send%22%3A%22true%22%2C%22extended_social_context%22%3A%22false%22%2C%22ret%22%3A%22sentry%22%2C%22act%22%3A%22connect%22%7D";
                                                    string response1 = HttpHelper.postFormData(new Uri("http://www.facebook.com/plugins/error/confirm/like"), postData1, referer);

                                                    string[] arrreload = Regex.Split(response1, "reload:");

                                                    if (arrreload.Length > 1)
                                                    {
                                                        try
                                                        {
                                                            string getRequest2ndurl = ((arrreload[1].Substring(0, arrreload[1].IndexOf("}"))).Replace(@"\", string.Empty).Replace("u0025", "%").Replace("\"", string.Empty).Trim());

                                                            string GetRequest2nd = HttpHelper.getHtmlfromUrl(new Uri(getRequest2ndurl));

                                                            string postData2 = "fb_dtsg=" + fb_dtsg + "&href=" + webSiteUrl + "&action=like&nobootload=&iframe_referer=http%3A%2F%2Fwww.facebook.com%2Fplugins%2Flike.php%3Fapi_key%3D113869198637480%26locale%3Den_US%26sdk%3Djoey%26channel_url%3Dhttp%253A%252F%252Fstatic.ak.facebook.com%252Fconnect%252Fxd_arbiter.php%253Fversion%253D18%2523cb%253Df22357d78bd7fa8%2526origin%253Dhttp%25253A%25252F%25252Fdevelopers.facebook.com%25252Ff3b0c888e33e4c8%2526domain%253Ddevelopers.facebook.com%2526relation%253Dparent.parent%26href%3D" + webSiteUrl + "%26node_type%3Dlink%26width%3D450%26layout%3Dstandard%26colorscheme%3Dlight%26show_faces%3Dtrue%26send%3Dtrue%26extended_social_context%3Dfalse&ref=&ret=sentry&__user="******"&__a=1&__req=1&phstamp=16581661025573108110765";

                                                            response = HttpHelper.postFormData(new Uri("http://www.facebook.com/plugins/like/connect"), postData2, getRequest2ndurl);
                                                        }
                                                        catch (Exception ex)
                                                        {
                                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                        }
                                                    }
                                                  
                                                }

                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        // Find Already Liked

                                        string[] arrHttp = System.Text.RegularExpressions.Regex.Split(response, "www");//http:

                                        if (arrHttp.Length < 2)
                                        {
                                            try
                                            {
                                                arrHttp = System.Text.RegularExpressions.Regex.Split(response, "http");//http:
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        if (arrHttp.Length > 1)
                                        {
                                            try
                                            {
                                                string[] arrComa = System.Text.RegularExpressions.Regex.Split(arrHttp[1], ",");

                                                if (arrComa.Length > 1)
                                                {
                                                    try
                                                    {

                                                        string strValue = arrComa[1].Replace("]]", string.Empty).Replace("\"", string.Empty).Trim();
                                                        string[] numericValue = System.Text.RegularExpressions.Regex.Split(strValue, "[^0-9]");

                                                        string realValue = string.Empty;
                                                        foreach (string item1 in numericValue)
                                                        {
                                                            if (!string.IsNullOrEmpty(item1))
                                                            {
                                                                realValue = item1;
                                                            }
                                                        }

                                                        if (realValue == (0).ToString())
                                                        {
                                                            GlobusLogHelper.log.Debug("Already Liked The Website : " + webSiteUrl + " With User Name : " + fbUser.username);
                                                            GlobusLogHelper.log.Info("Already Liked The Website : " + webSiteUrl + " With User Name : " + fbUser.username);
                                                            
                                                          
                                                                int delayInSeconds = Utils.GenerateRandom(minDelayWebSiteLiker * 1000, maxDelayWebSiteLiker * 1000);
                                                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With User Name : " + fbUser.username);
                                                                Thread.Sleep(delayInSeconds);
                                                           
                                                        }
                                                        else
                                                        {
                                                            counter_LikesWithAccount++;

                                                            GlobusLogHelper.log.Info("Liked The Website : " + webSiteUrl + " With User Name : " + fbUser.username);

                                                            GlobusLogHelper.log.Info(counter_LikesWithAccount + " Liked The Website : " + webSiteUrl + " With User Name : " + fbUser.username);

                                                            //Update Dictionary
                                                            AddUpdatedictionary_LikesOnPage(webSiteUrl, maxCountOnPage);

                                                            // Data Save In CSV File

                                                            //if (!string.IsNullOrEmpty(_ExprotFilePath))
                                                            //{
                                                            //    string CSVHeader = "UserName" + ", " + "WebSite URL " + ", " + "Liked" + ", " + "AlReady_Liked";
                                                            //    string CSV_Content = strUserName + "," + webSiteUrl + "," + "Liked" + "," + "";

                                                            //    FBApplicationData.ExportDataCSVFile(CSVHeader, CSV_Content, _ExprotFilePath);
                                                            //}

                                                            //Delay
                                                           // if (UseDelay)
                                                            {
                                                                int delayInSeconds = Utils.GenerateRandom(minDelayWebSiteLiker * 1000, maxDelayWebSiteLiker * 1000);
                                                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With User Name : " + fbUser.username);
                                                                Thread.Sleep(delayInSeconds);
                                                            }
                                                        }
                                                    }
                                                    catch
                                                    {
                                                        GlobusLogHelper.log.Info(" couldn't Like The Website : " + webSiteUrl + " With User Name : " + fbUser.username);
                                                    }
                                                }
                                                else
                                                {
                                                    if (!Statusliked)
                                                    {
                                                        //if (arrHttp[0].Contains("Log In"))
                                                        {
                                                            GlobusLogHelper.log.Info(" You're Temporarily Blocked for 30 Days so couldn't  Like The Website : " + webSiteUrl + " With User Name : " + fbUser.username);
                                                        }
                                                        //else
                                                        //{
                                                        //    Log(" couldn't Like The Website : " + webSiteUrl + " With User Name : " + strUserName);

                                                        //}
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                        else
                                        {
                                            GlobusLogHelper.log.Info(" couldn't Like The Website : " + webSiteUrl + " With User Name : " + fbUser.username);
                                        }

                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }

                                //  Log("Process Completed With User Name : " + strUserName);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                    GlobusLogHelper.log.Info("Process Completed With User Name : " +fbUser.username);



                    #region MyRegion
                    //try
                    //{
                    //    string fb_dtsg = string.Empty;
                    //    string page_id = string.Empty;


                    //    try
                    //    {

                    //        string PageSourceanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanPageUrl_item));

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

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

                    //            return;
                    //        }

                    //        fb_dtsg = GlobusHttpHelper.GetParamValue(PageSourceanPageUrl, "fb_dtsg");
                    //        if (string.IsNullOrEmpty(fb_dtsg))
                    //        {
                    //            fb_dtsg = GlobusHttpHelper.ParseJson(PageSourceanPageUrl, "fb_dtsg");
                    //        }
                    //        string FanPageUrl = FanPageUrl_item;
                    //        page_id = GlobusHttpHelper.GetPageID(PageSourceanPageUrl, ref FanPageUrl);

                    //        //Find Friends ID List
                    //        int count_Friends = FriendInfoScraper.ExtractFriendCount(ref fbUser, UserId);

                    //        listFriendId.Clear();

                    //        GlobusLogHelper.log.Info("Please wait finding the friends ID...");
                    //        GlobusLogHelper.log.Debug("Please wait finding the friends ID...");

                    //        //List<string> lstFriends = FriendInfoScraper.ExtractFriendIdsFb(ref fbUser, ref HttpHelper, ref UserId, count_Friends);
                    //        List<string> lstFriends = new List<string>();
                    //        try
                    //        {
                    //            lstFriends = FBUtils.GetAllFriends(ref HttpHelper, UserId);
                    //            lstFriends = lstFriends.Distinct().ToList();
                    //        }
                    //        catch (Exception ex)
                    //        {
                    //            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    //        }

                    //        int CountSendInvite = 0;
                    //        foreach (var lstFriends_item in lstFriends)
                    //        {
                    //            try
                    //            {

                    //                if (FanPageInviterNoOfFriendSendInviter <= CountSendInvite)
                    //                {
                    //                    break;
                    //                }

                    //                string PostData = "page_id=" + page_id + "&invitee=" + lstFriends_item + "&action=send&ref=finch_about_build_audience&__user="******"&__a=1&__dyn=aJswFeyj2qm9a5k9VUgGhaiV925xSq78hACl5DlqUSS-CEy5pokAWCyaG8z8gKAqhB-fjw&__req=9&fb_dtsg=" + fb_dtsg + "&ttstamp=265816911110311176851225611890&__rev=1363263";
                    //                string PostUrl = FBGlobals.Instance.PageManagerFanPageInviter;                  // "https://www.facebook.com/ajax/pages/invite/send_single/";

                    //                string response = HttpHelper.postFormDataSendInvite(new Uri(PostUrl), PostData);

                    //                if (response.Contains("\"payload\":null,\"bootloadable\""))
                    //                {
                    //                    CountSendInvite = CountSendInvite + 1;

                    //                    GlobusLogHelper.log.Debug(CountSendInvite + " : invitation Send : " + lstFriends_item + " with UserName : "******" for Fan Page Url : " + FanPageUrl_item);
                    //                    GlobusLogHelper.log.Info(CountSendInvite + " : invitation Send : " + lstFriends_item + " with UserName : "******" for Fan Page Url : " + FanPageUrl_item);



                    //                    try
                    //                    {
                    //                        int delayInSeconds = Utils.GenerateRandom(minDelayFanPageInviter * 1000, maxDelayFanPageInviter * 1000);
                    //                        GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                    //                    }
                    //                }
                    //                else
                    //                {
                    //                    Thread.Sleep(1000);
                    //                }

                    //            }
                    //            catch (Exception ex)
                    //            {
                    //                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    //            }
                    //        }

                    //    }
                    //    catch (Exception ex)
                    //    {
                    //        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    //    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    //} 
                    #endregion

                   
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #18
0
        /// <summary>
        /// targeted CommentLiker add by ajay yadav
        /// </summary>
        /// <param name="oo"></param>

        private void CommentLiker(ref FacebookUser fbUser)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
                foreach (string lstFanPageCommentURLs_item in lstFanPageUrlTargedCollectionCommentLiker)
                {
                    try
                    {
                        PostCommentLiker(ref fbUser, lstFanPageCommentURLs_item);                     
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            GlobusLogHelper.log.Info("Process completed With Username >>> " + fbUser.username);
            GlobusLogHelper.log.Debug("Process completed With Username >>> " + fbUser.username);
        }
예제 #19
0
        public void LikePage(ref FacebookUser fbUser, List<string> lstFanPageUrlsFanPageLiker)
        {
            try
            {
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

                #region Post variable

                string fbpage_id = string.Empty;
                string fb_dtsg = string.Empty;
                string __user = string.Empty;
                string xhpc_composerid = string.Empty;
                string xhpc_targetid = string.Empty;
                string xhpc_composerid12 = string.Empty;
                int NoOfEmailAccount = 20;
                int countPost=0;

                #endregion
               
                List<string> FanpageUrls = lstFanPageUrlsFanPageLiker;

                foreach (string item in FanpageUrls)
                {
                    try
                    {
                        string FanpageUrl = item;

                        GlobusLogHelper.log.Info("Started Liking Page " + FanpageUrl + "  with " + fbUser.username);
                        GlobusLogHelper.log.Debug("Started Liking Page " + FanpageUrl + "  with " + fbUser.username);

                        string PageSrcFanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));

                        //PostOnFanPageCommentWithURLAndItsImage(ref HttpHelper);
                        ///JS, CSS, Image Requests
                        //RequestsJSCSSIMG.RequestJSCSSIMG(PageSrcFanPageUrl, ref HttpHelper);

                        #region Extra Requests Before Like
                        string aed = string.Empty;

                        if (PageSrcFanPageUrl.Contains("aed="))
                        {
                            try
                            {
                                string strfb_dtsg = PageSrcFanPageUrl.Substring(PageSrcFanPageUrl.IndexOf("aed="), 1500);
                                string[] Arrfb_dtsg = strfb_dtsg.Split('"');
                                aed = Arrfb_dtsg[0];
                                aed = aed.Replace("\\", "");
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                        }

                        string strUrlAed = FBGlobals.Instance.PageManagerFanPageLikerstrUrlAed + aed;

                        try
                        {
                            string PageSrcFanPageUrlAed = HttpHelper.getHtmlfromUrl(new Uri(strUrlAed));
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        ///JS, CSS, Image Requests
                        //RequestsJSCSSIMG.RequestJSCSSIMG(PageSrcFanPageUrlAed, ref HttpHelper);

                        #endregion

                        GlobusLogHelper.log.Info("Liking : " + FanpageUrl + " With UserName : "******"user");     //pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
                        if (string.IsNullOrEmpty(__user))
                        {
                            __user = GlobusHttpHelper.ParseJson(PageSrcFanPageUrl, "user");
                        }

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

                            return;
                        }

                        try
                        {
                            fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(PageSrcFanPageUrl);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(" Error: " + ex.StackTrace);

                        }

                        #endregion

                        #region Get FB Page ID Modified

                        ///Get FB Page ID
                        fbpage_id = GlobusHttpHelper.GetPageID(PageSrcFanPageUrl, ref FanpageUrl);


                        #endregion


                        #region Modified 7-6-12

                        string postURL_1st = FBGlobals.Instance.PageManagerFanPageLikerpostURL1st;
                        string postData_1st = "fbpage_id=" + fbpage_id + "&add=true&reload=false&fan_origin=page_timeline&nctr[_mod]=pagelet_timeline_page_actions&fb_dtsg=" + fb_dtsg + "&__user="******"&phstamp=" + Utils.GenerateTimeStamp() + "";

                        string res_post_1st = string.Empty;

                        try
                        {
                            res_post_1st = HttpHelper.postFormData(new Uri(postURL_1st), postData_1st);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        if (string.IsNullOrEmpty(res_post_1st))
                        {
                            try
                            {

                                //fbpage_id=107539342664071&add=true&reload=false&fan_origin=page_timeline&fan_source=&cat=&nctr[_mod]=pagelet_timeline_page_actions&__user=100001330463773&__a=1&__dyn=798ahxoNoBKfEa0&__req=o&fb_dtsg=AQDXABnH&phstamp=165816888656611072206
                                string postData_2 = "fbpage_id=" + fbpage_id + "&add=true&reload=false&fan_origin=page_timeline&fan_source=&cat=&nctr[_mod]=pagelet_timeline_page_actions&__user="******"&__a=1&__dyn=&__req=o&fb_dtsg=" + fb_dtsg + "" + "&phstamp=" + Utils.GenerateTimeStamp() + "";

                                res_post_1st = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerFanStatus), postData_2);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Liking Error: " + ex.StackTrace);
                                continue;
                            }
                        }



                        string CSVHeader = "UserName" + "," + "FanpageUrl";
                        string CSV_Content = fbUser.username + "," + FanpageUrl;


                        if (res_post_1st.Contains("Security Check Required"))
                        {
                            string content = fbUser.username + ":" + fbUser.password;

                            GlobusLogHelper.log.Info("Security Check Required " + FanpageUrl + "  with " + fbUser.username);
                            GlobusLogHelper.log.Debug("Security Check Required " + FanpageUrl + "  with " + fbUser.username);


                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Already connected"))
                        {
                            string content = fbUser.username + ":" + fbUser.password;

                            //CreateFileLikeDeskTop(content, "UnLike");

                            GlobusLogHelper.log.Info("Already Liked " + FanpageUrl + "  with " + fbUser.username);
                            GlobusLogHelper.log.Debug("Already Liked " + FanpageUrl + "  with " + fbUser.username);

                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"\"errorSummary\""))
                        {
                            try
                            {
                                string summary = GlobusHttpHelper.ParseJson(res_post_1st, "errorSummary");
                                string errorDescription = GlobusHttpHelper.ParseJson(res_post_1st, "errorDescription");

                                GlobusLogHelper.log.Info("Liking Error: " + summary + " | Error Description: " + errorDescription);
                                GlobusLogHelper.log.Debug("Liking Error: " + summary + " | Error Description: " + errorDescription);


                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Please log in to continue"))
                                {
                                    string content = fbUser.username + ":" + fbUser.password;
                                    return;
                                }
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error(" Error: " + ex.StackTrace);

                            }

                        }
                        else
                        {
                            TotalFanPagelikeCounter++;
                            countPost++;
                            GlobusLogHelper.log.Info("Liked " + FanpageUrl + "  with " + fbUser.username + "<:>" + TotalFanPagelikeCounter.ToString());
                            GlobusLogHelper.log.Debug("Liked " + FanpageUrl + "  with " + fbUser.username + "<:>" + TotalFanPagelikeCounter.ToString());
                            
                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******":" + Password + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_SuccessfulLikerAccounts);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error(" Error: " + ex.StackTrace);

                            }

                            // WriteLikedCounterAtLabel();

                            //CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LikedPages);
                        }

                        string postURL_2nd = FBGlobals.Instance.PageManagerFanPageLikerpostURL2nd;
                        string postData_2nd = "profile_id=" + fbpage_id + "&tab_key=timeline&fb_dtsg=" + fb_dtsg + "&__user="******"&phstamp=" + Utils.GenerateTimeStamp() + "";
                        string res_post_2nd = HttpHelper.postFormData(new Uri(postURL_2nd), postData_2nd);
                        #endregion

                        //Delay
                        //if (UseDelay)
                        {
                            //int delayInSeconds = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                            //GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******" Error: " + ex.StackTrace);

                    }

                    if (NoOfPostFanPageLikercount == countPost)
                    {
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error: " + ex.StackTrace);

            }

            GlobusLogHelper.log.Info("Process Completed With Username >>> " + fbUser.username);
            GlobusLogHelper.log.Debug("Process Completed With Username >>> " + fbUser.username);
        }
예제 #20
0
        public void PostCommentLiker(ref FacebookUser fbUser, string postpageUrl)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
                    GlobusLogHelper.log.Debug("Start Liking Particular Comment URL >>> " + postpageUrl + " With Username >>> " + fbUser.username);

                    string comment_id = string.Empty;
                    string fbid = string.Empty;
                    string set = string.Empty;
                    string dtsg = string.Empty;
                   
                    string pagesource = HttpHelper.getHtmlfromUrl(new Uri(postpageUrl));
                  
                    if (string.IsNullOrEmpty(pagesource))
                    {
                        pagesource = HttpHelper.getHtmlfromUrl(new Uri(postpageUrl));     
                    }
                    if (pagesource.Contains("&amp;set="))
                    {
                        try
                        {
                            int startindex = pagesource.IndexOf("&amp;set=");
                            int endindex = pagesource.IndexOf("type=");
                            set = pagesource.Substring(startindex, endindex - startindex).Replace("&amp;set=", string.Empty).Replace("&amp;", string.Empty).Trim();
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    else
                    {
                        try
                        {
                            string s = Utils.getBetween(pagesource, "targetfbid", "entidentifier");
                            s = s.Replace("\":\"", string.Empty).Replace("\",\"","");
                            fbid = s;
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
              

                    if (postpageUrl.Contains("fbid="))
                    {
                        try
                        {
                            int startindex = postpageUrl.IndexOf("fbid=");
                            int endindex = postpageUrl.IndexOf("&set");
                            fbid = postpageUrl.Substring(startindex, endindex - startindex).Replace("fbid=", string.Empty).Trim();                                    
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    else 
                    {
                        try
                        {
                            if (string.IsNullOrEmpty(fbid))
                            {
                                try
                                {
                                    int startindex = pagesource.IndexOf("fbid=");
                                    int endindex = pagesource.IndexOf("&set");
                                    string ss = pagesource.Substring(startindex, endindex - startindex).Replace("fbid=", string.Empty).Trim();
                                    string[] arr = ss.Split('\"');
                                    fbid = arr[0];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                
                            }
                            else
                            {
                                if (string.IsNullOrEmpty(fbid))
                                {
                                    try
                                    {
                                        fbid = Utils.getBetween(pagesource, "fbid=", "&set");
                                        if (fbid.Contains("&") && fbid.Contains("amp"))
                                        {
                                            fbid = Utils.getBetween(pagesource, "fbid=", "&amp;");
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }

                            }
                        }
                        catch (Exception ex)
                        {
                            //fbid = Utils.getBetween(pagesource, "fbid=", "&set");
                            //if (fbid.Contains("&") && fbid.Contains("amp"))
                            //{
                            //    fbid = Utils.getBetween(pagesource, "fbid=", "&amp;");
                            //}
                            GlobusLogHelper.log.Error(ex.Message);
                        }
                    }               

                    if (postpageUrl.Contains("comment_id"))
                    {
                        try
                        {
                            int startindex = postpageUrl.IndexOf("comment_id=");
                            int endindex = postpageUrl.IndexOf("&offset");
                            comment_id = postpageUrl.Substring(startindex, endindex - startindex).Replace("comment_id=", string.Empty).Trim();
                        }
                        catch (Exception ex)
                        {
                            string[] arr = System.Text.RegularExpressions.Regex.Split(postpageUrl, "comment_id=");
                            comment_id=arr[1];
                            GlobusLogHelper.log.Error(ex.Message);
                        } 
                    }
                    if (pagesource.Contains("dtsg"))
                    {
                        try
                        {
                            int startindex = pagesource.IndexOf("fb_dtsg");
                            int endindex = pagesource.IndexOf("ajaxpipe_token");
                            dtsg = pagesource.Substring(startindex, endindex - startindex).Replace("fb_dtsg", string.Empty).Replace("&amp;", string.Empty).Replace("\",\"", string.Empty).Replace("\":\"", string.Empty).Trim();                                   
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        try
                        {
                            if (dtsg == "")
                            {
                                dtsg = GlobusHttpHelper.Get_fb_dtsg(pagesource);
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        
                    }

                    string userid = GlobusHttpHelper.Get_UserID(pagesource);
                    string pagesource1 = string.Empty;

                    string _SVN = Utils.getBetween(pagesource, "_rev", ",");
                    _SVN = _SVN.Replace("\":",string.Empty);
                    string commenID = Utils.getBetween(pagesource, ".php?v=", "&amp;");
                    string _rev = Utils.getBetween(pagesource, "_rev\":", ",");
                    string ft_ent_identifier = Utils.getBetween(pagesource, "ftentidentifier\":", ",");
                    ft_ent_identifier = ft_ent_identifier.Replace("\"",string.Empty);
                    try
                    {

                        //change post data 17/12/2013 by ajay kumar yadav  post data for pic comments 

                        try
                        {
                            string postdata = "comment_id=" + fbid + "_" + comment_id + "&legacy_id=" + comment_id + "&like_action=true&ft_ent_identifier=" + fbid + "&source=2&client_id=&ft[tn]=%3ER1]&__user="******"&__a=1&__dyn=&__req=e&fb_dtsg=" + dtsg + "&phstamp=1658166887010910498237";
                            pagesource1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageFanPagePosterAjaxUfiCommentLikePhp), postdata);

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                        //Create new post data  17/12/2013  by ajay kumar yadav  post data for  video comments 
                        if (string.IsNullOrEmpty(pagesource1))
                        {
                            string postdata1 = "comment_id=" + commenID + "_" + comment_id + "&legacy_id=" + comment_id + "&like_action=true&ft_ent_identifier=" + ft_ent_identifier + "&source=2&client_id=1387448430300%3A4135632999&ft[tn]=%3ER9]&__user="******"&__a=1&__dyn=7n8apij35CFUSt2u5KIGKaExEW9ACxO4pbGAdGm&__req=k&fb_dtsg=" + dtsg + "&__rev=" + _rev + "&ttstamp=2658168122979010753";
                            pagesource1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageFanPagePosterAjaxUfiCommentLikePhp), postdata1);

                        }

                        if (pagesource1.Contains("This doesn't seem to be possible just now. Please try again"))
                        {
                            try
                            {
                                string page = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerPagePosterAjaxAjaxPresenceReconnectPhp + userid + "&__a=1&__dyn=7n8apij35CFUSt2u5KIGKaExEW9ACxO4pbGA9w&__req=r&__rev=" + _SVN + "&fb_dtsg=" + dtsg + ""));                     

                                string lastActionID = Utils.getBetween(pagesource, "last_action_id", ",");
                                lastActionID = lastActionID.Replace("\"", string.Empty).Replace(":", string.Empty);

                                string PostData2nd = "last_action_id=" + lastActionID + "&folders[0]=inbox&client=mercury&__user="******"&__a=1&__dyn=7n8apij35CFUSt2u5KIGKaExEW9ACxO4pbGA9w&__req=s&fb_dtsg=" + dtsg + "&__rev=" + _SVN + "&ttstamp=2658168681177211978";
                                string gg = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerPageAjaxMercury), PostData2nd);


                                string postdata1 = "comment_id=" + commenID + "_" + comment_id + "&legacy_id=" + comment_id + "&like_action=true&ft_ent_identifier=" + ft_ent_identifier + "&source=2&client_id=1387448430300%3A4135632999&ft[tn]=%3ER9]&__user="******"&__a=1&__dyn=7n8apij35CFUSt2u5KIGKaExEW9ACxO4pbGAdGm&__req=k&fb_dtsg=" + dtsg + "&__rev=" + _rev + "&ttstamp=2658168122979010753";
                                pagesource1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageFanPagePosterAjaxUfiCommentLikePhp), postdata1);                               
                                
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }
                        }

                        #region CodeCommented
                        //string postdata2 = "comment_id=657264170978481_9011745&legacy_id=9011745&like_action=true&ft_ent_identifier=657264170978481&source=2&client_id=1387625253339%3A1591471781&ft[tn]=%3ER]&__user=100005237021539&__a=1&__dyn=7n8apij35CFUSt2u5KIGKaExEW9ACxO4pbGAdGm&__req=g&fb_dtsg=AQDzaZk5&__rev=1055839&ttstamp=2658168122979010753";
                        //pagesource1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageFanPagePosterAjaxUfiCommentLikePhp), postdata2);    
                        #endregion
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                   

                    if (pagesource1 == "")
                    {
                        GlobusLogHelper.log.Info("Comment already Liked >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                        GlobusLogHelper.log.Debug("Comment already Liked >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                    }
                    else
                    {
                        if (!pagesource1.Contains("error") || pagesource1.Contains("boosted_pagelikes"))
                        {
                            GlobusLogHelper.log.Info("Liked Particular Comment URL >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                            GlobusLogHelper.log.Debug("Liked Particular Comment URL >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                        }
                        else
                        {
                            GlobusLogHelper.log.Info(" Couldn't Like Particular Comment URL >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                            GlobusLogHelper.log.Info(" Couldn't Like Particular Comment URL >>> " + postpageUrl + " With Username >>> " + fbUser.username);
                        }
                    }
                    try
                    {
                        int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                        GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                    }             
                                   
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }             
        }
예제 #21
0
        public List<string> Extractkeywordid(ref FacebookUser fbUser, string lkey,string userid)
        {
            List<string> toatalid = new List<string>();
            GlobusHttpHelper chilkathttphelr = fbUser.globusHttpHelper;

            try
            {
                int offset = 10;
                int countlimit = 0;
                int countKeyword_id = 0;
                GlobusLogHelper.log.Debug("Please wait.....");

                string extractkeywordslimit = chilkathttphelr.getHtmlfromUrl(new Uri("https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + offset.ToString() + "&pagesize=300&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"pages");



                if (extractkeywordslimit.Contains("displayed"))
                {
                    string[] keyword_idarr = Regex.Split(extractkeywordslimit, "displayed");
                    for (int i = 1; i < keyword_idarr.Length; i++)
                    {
                        string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);

                        toatalid.Add(keyword_idarritem);
                        GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Please wait.....");
                        GlobusLogHelper.log.Info("Please wait.....");
                        string AJaxURL = "https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + j.ToString() + "&pagesize=200&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                        {
                            string[] keyword_idarr = Regex.Split(pagesourceofKeyword_idforoffset1, "displayed");
                            flage = true;
                            for (int i = 1; i < keyword_idarr.Length; i++)
                            {
                                string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                toatalid.Add(keyword_idarritem);
                                GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + j.ToString() + "&pagesize=150&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                            {
                                string[] keyword_idarr = Regex.Split(pagesourceofKeyword_idforoffset1, "displayed");
                                flage = true;
                                for (int i = 1; i < keyword_idarr.Length; i++)
                                {
                                    string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                    toatalid.Add(keyword_idarritem);
                                    GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + j.ToString() + "&pagesize=100&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                                {
                                    string[] keyword_idarr = Regex.Split(pagesourceofKeyword_idforoffset1, "displayed");
                                    flage = true;
                                    for (int i = 1; i < keyword_idarr.Length; i++)
                                    {
                                        string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                        toatalid.Add(keyword_idarritem);
                                        GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + j.ToString() + "&pagesize=75&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                                    {
                                        string[] keyword_idarr = Regex.Split(pagesourceofKeyword_idforoffset1, "displayed");
                                        flage = true;
                                        for (int i = 1; i < keyword_idarr.Length; i++)
                                        {
                                            string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                            toatalid.Add(keyword_idarritem);
                                            GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"displayed"))
                        if (flage)
                        {
                            break;
                        }
                        countlimit++;
                        break;
                    }
                }

                string pagesourceofKeyword_idforoffset = chilkathttphelr.getHtmlfromUrl(new Uri("https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + offset.ToString() + "&pagesize=100&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                {
                    while (ExtractKeyword_idsFbforOffSet(ref fbUser, ref userid, offset))
                    {
                        GlobusLogHelper.log.Debug("Please wait.....");
                        GlobusLogHelper.log.Info("Please wait.....");
                        string pagesourceofKeyword_idforoffset2 = chilkathttphelr.getHtmlfromUrl(new Uri("https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + offset.ToString() + "&pagesize=50&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                        {
                            string[] keyword_idarr = Regex.Split(pagesourceofKeyword_idforoffset2, "displayed");

                            for (int i = 1; i < keyword_idarr.Length; i++)
                            {
                                string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                toatalid.Add(keyword_idarritem);
                                GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + j.ToString() + "&pagesize=20&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                        {
                            string[] keyword_idarr = Regex.Split(pagesourceofsnippet_idforoffset1, "displayed");

                            for (int i = 1; i < keyword_idarr.Length; i++)
                            {
                                string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                toatalid.Add(keyword_idarritem);
                                GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"displayed"))
                        {
                            break;
                        }
                        countKeyword_id++;

                        string pagesourceofsnippet_idforoffset2 = chilkathttphelr.getHtmlfromUrl(new Uri("https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + countKeyword_id.ToString() + "&pagesize=10&q=" + lkey + "&type=all&init=quick&__a=1&__user="******"displayed"))
                        {
                            string[] keyword_idarr = Regex.Split(pagesourceofsnippet_idforoffset2, "displayed");

                            for (int i = 1; i < keyword_idarr.Length; i++)
                            {
                                string keyword_idarritem = keyword_idarr[i].Substring(keyword_idarr[i].IndexOf("55D="), keyword_idarr[i].IndexOf("&amp;") - keyword_idarr[i].IndexOf("55D=")).Replace("55D=", string.Empty);
                                toatalid.Add(keyword_idarritem);
                                GlobusLogHelper.log.Debug("Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : "******"Fan Page ID : " + keyword_idarritem + " Keyword : " + lkey + " with UserName : " + fbUser.username);
                            }
                        }
                        break;

                    }
                    toatalid = toatalid.Distinct().ToList();
                }
            }
            catch (Exception ex)
            {
                string exmsg = ex.Message;
            }
            return toatalid;
        }
예제 #22
0
        /// <summary>
        /// PhotoLiker Method add by ajay kumar yadav 21/12/2013
        /// </summary>
        /// <param name="fbUser"></param>
        

        public void StartPhotoLiker(ref FacebookUser fbUser)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
                string fb_dtsg = "";
                string __user = "";
                string strEventURLPageSource = "";
                string ft_ent_identifier = string.Empty;
                string Username = fbUser.username;

                foreach (string item in lstFanPageUrlCollectionCommentLiker)
                {

                    try
                    {
                        strEventURLPageSource = HttpHelper.getHtmlfromUrl(new Uri(item));
                        __user = GlobusHttpHelper.GetParamValue(strEventURLPageSource, "user");  //pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
                        if (string.IsNullOrEmpty(__user))
                        {
                            __user = GlobusHttpHelper.ParseJson(strEventURLPageSource, "user");
                        }

                        fb_dtsg =GlobusHttpHelper.Get_fb_dtsg(strEventURLPageSource);
                        try
                        {
                            ft_ent_identifier = item.Substring(item.IndexOf("?fbid="), item.Length - item.IndexOf("?fbid=")).Replace("?fbid=", string.Empty).Trim();
                        }
                        catch (Exception ex)
                        {                            
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {
                            string[] Arr = System.Text.RegularExpressions.Regex.Split(item,"/");
                            ft_ent_identifier=Arr[6];
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        string postData = "like_action=true&ft_ent_identifier=" + ft_ent_identifier + "&source=2&client_id=1357365511041%3A1142013411&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&__req=5&fb_dtsg=" + fb_dtsg + "&phstamp=1658168106858611353174";
                        string response = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PagePagePosterAjaxUfiLikePhp), postData);

                        #region CodeCommented
                        //string SecondUpdatedPostData = "like_action=true&ft_ent_identifier="+ft_ent_identifier+"&source=2&client_id=1395989349482%3A642456910&rootid=u_0_8&giftoccasion&ft[tn]=%3E%3D]&ft[type]=20&__user="******"&__a=1&__dyn=7n8apij2qm9udDgDxyG8EipEtCxO4pbGAdGGzQAjFDy8gBw&__req=e&fb_dtsg=AQDtCGgQ&ttstamp=2658168116677110381&__rev=1181477";
                        //string response1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PagePagePosterAjaxUfiLikePhp), SecondUpdatedPostData); 
                        #endregion


                        if (response.Contains("error") && !response.Contains("likecount-update"))
                        {
                            try
                            {
                                string[] summaryArr = Regex.Split(response, "errorSummary\":");
                                summaryArr = Regex.Split(summaryArr[1], "\"");
                                string errorSummery = summaryArr[1];
                                string errorDiscription = summaryArr[5];

                                GlobusLogHelper.log.Debug("PhotoId:" + ft_ent_identifier + " Error Summary : " + errorSummery + " And Error Description :" + errorDiscription + "  With UserName : "******"Error : " + ex.StackTrace);
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Debug("Liked PhotoId : " + ft_ent_identifier + " with UserName : "******" for URL : " + item);
                            GlobusLogHelper.log.Info("Liked PhotoId : " + ft_ent_identifier + " with UserName : "******" for URL : " + item);

                            // Save Data Into CSV File
                            try
                            {
                                string CSVHeader = "User_Name" + "," + "PhotoId" + ", " + "PhotoURL";
                                string CSV_Content = Username + "," + ft_ent_identifier + ", " + item;
                               // FBApplicationData.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.Path_PhotoLikerDetails);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            try
                            {
                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }

                GlobusLogHelper.log.Debug("Process Completed With User Name : " + Username);
                GlobusLogHelper.log.Info("Process Completed With User Name : " + Username);
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #23
0
        //New Task For Likes on Freinds Urls Done By Mahesh

        public void LikePostsOnFreindsPage(ref FacebookUser fbUser, List<string> lstFreindsUrls)
        {
            string __user = string.Empty;
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            
            string ResponseLogin = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));
            __user = GlobusHttpHelper.GetParamValue(ResponseLogin, "user");

            string fb_dtsg=Get_fb_dtsg(ResponseLogin);
            if (string.IsNullOrEmpty(__user))
            {
                __user = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
            }
            if (string.IsNullOrEmpty(__user) || __user == "0" || __user.Length < 3)
            {
                GlobusLogHelper.log.Info("Please Check The Account : " + fbUser.username);
                GlobusLogHelper.log.Debug("Please Check The Account : " + fbUser.username);
                return;
            }
           
            string pageSource1 = ResponseLogin;
            string FriendId = string.Empty;

            while (queueFriendsUrlFriendsPostLiker.Count != 0)
            {
                List<string> lstPostsId = new List<string>();
                string FriendUrl = queueFriendsUrlFriendsPostLiker.Dequeue();
                GlobusLogHelper.log.Info("Start Like Posts  with " + FriendUrl);
                GlobusLogHelper.log.Debug("Start Like Post  with " + FriendUrl);
                FriendId = GetFriendUserId(ref fbUser, FriendUrl);
                string ajaxpipe_token = string.Empty;
                string FreindPageResponse = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/profile.php?id=" + FriendId));
                string Pagelet = Utils.getBetween(FreindPageResponse, "ProfileTimelineSectionPagelet\\\",", "}");
                Pagelet = Pagelet.Replace(" ", string.Empty);
                Pagelet = Pagelet + "}";
                Pagelet = Pagelet.Replace("\\", string.Empty);
                Pagelet = Uri.EscapeDataString(Pagelet);

                string end = Utils.getBetween(FreindPageResponse, "\"end\":", ",");
                ajaxpipe_token = Utils.getBetween(FreindPageResponse, "ajaxpipe_token\":\"", "\"");
                string[] splitmainhtml = System.Text.RegularExpressions.Regex.Split(FreindPageResponse, "feedbacktargets");
                string postid = string.Empty;
                bool isValidUrl = true;
                foreach (string html in splitmainhtml)
                {
                    if (html.Contains("targetfbid"))
                    {
                        try
                        {
                            postid = Utils.getBetween(html, "targetfbid\":\"", "\",\"entidentifier");
                            lstPostsId.Add(postid);
                        }
                        catch (Exception ex)
                        {
                            postid = Utils.getBetween(html, "targetfbid\":\"","\"");
                            lstPostsId.Add(postid);
                            GlobusLogHelper.log.Error(ex.Message);
                        }
                    }

                }
                #region commented
                /*for (int i = 2; i < 8; i++)
                {
                    string pageletUrl = "https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=" + Pagelet + "%2C%22num_visible_units%22%3A5%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_8&__rev=1537314&__adt="+i;
                    pageletUrl = pageletUrl.Replace("%20", string.Empty);
                    
                    
                    Pagelet = Utils.getBetween(FreindPageResponse, "ProfileTimelineSectionPagelet\\\",", "}");
                    Pagelet = Pagelet.Replace(" ", string.Empty);
                    Pagelet = Pagelet + "}";
                    Pagelet = Pagelet.Replace("\\", string.Empty);
                    Pagelet = Uri.EscapeDataString(Pagelet);
                    string str1="page_index%22%3A" + (i - 1);
                    string str2="page_index%22%3A" + i;
                    Pagelet = Pagelet.Replace(str1,str2);
                    pageletUrl = "https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=" + Pagelet + "%2C%22num_visible_units%22%3A5%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_8&__rev=1537314&__adt=" + i;
                    string pageletUrlResponse = HttpHelper.getHtmlfromUrl(new Uri(pageletUrl));
                    if (pageletUrlResponse.Contains("feedbacktargets"))
                    {
                        string[] splitmainhtml1 = System.Text.RegularExpressions.Regex.Split(pageletUrlResponse, "feedbacktargets");
                        // pageIndex++;
                        // adt++;
                        foreach (string html in splitmainhtml)
                        {
                            if (html.Contains("targetfbid"))
                            {
                                postid = Utils.getBetween(html, "targetfbid\":\"", "\",\"entidentifier");
                                lstPostsId.Add(postid);
                            }

                        }
                    }
                
                } */

                #endregion
                List<string> pageletList = new List<string>();
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A0%2C%22end%22%3A1420099199%2C%22query_type%22%3A36%2C%22page_index%22%3A1%2C%22section_container_id%22%3A%22u_0_16%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_15%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22buffer%22%3A50%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Atrue%2C%22tipld%22%3A%7B%22sc%22%3A2%2C%22rc%22%3A5%2C%22vc%22%3A5%7D%2C%22num_visible_units%22%3A5%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxembzESu49UJ6K59poW8xHzoyfw&__req=jsonp_2&__rev=1538717&__adt=2");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A0%2C%22end%22%3A1420099199%2C%22query_type%22%3A36%2C%22page_index%22%3A2%2C%22section_container_id%22%3A%22u_0_16%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_15%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22buffer%22%3A500%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Atrue%2C%22tipld%22%3A%7B%22sc%22%3A6%2C%22rc%22%3A18%2C%22vc%22%3A20%7D%2C%22num_visible_units%22%3A20%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_3&__rev=1538717&__adt=3");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A0%2C%22end%22%3A1420099199%2C%22query_type%22%3A36%2C%22page_index%22%3A3%2C%22section_container_id%22%3A%22u_0_16%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_15%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22buffer%22%3A250%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Afalse%2C%22tipld%22%3A%7B%22sc%22%3A10%2C%22rc%22%3A18%2C%22vc%22%3A44%7D%2C%22num_visible_units%22%3A44%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_4&__rev=1538717&__adt=4");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=AXiPlphY5F8Sjmr5&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A0%2C%22end%22%3A1420099199%2C%22query_type%22%3A36%2C%22page_index%22%3A4%2C%22section_container_id%22%3A%22u_0_16%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_15%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22buffer%22%3A250%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Afalse%2C%22tipld%22%3A%7B%22sc%22%3A14%2C%22rc%22%3A18%2C%22vc%22%3A92%7D%2C%22num_visible_units%22%3A92%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_5&__rev=1538717&__adt=5");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=AXiPlphY5F8Sjmr5&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A1388563200%2C%22end%22%3A1420099199%2C%22query_type%22%3A8%2C%22filter_after_timestamp%22%3A1416415349%2C%22section_pagelet_id%22%3A%22pagelet_timeline_year_current%22%2C%22load_immediately%22%3Afalse%2C%22force_no_friend_activity%22%3Afalse%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_6&__rev=1538717&__adt=6");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=AXiPlphY5F8Sjmr5&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A1388563200%2C%22end%22%3A1420099199%2C%22query_type%22%3A8%2C%22filter_after_timestamp%22%3A1416415349%2C%22page_index%22%3A1%2C%22section_container_id%22%3A%22u_jsonp_6_1%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_year_current%22%2C%22unit_container_id%22%3A%22u_jsonp_6_0%22%2C%22current_scrubber_key%22%3A%22year_2014%22%2C%22buffer%22%3A500%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Atrue%2C%22tipld%22%3A%7B%22sc%22%3A8%2C%22rc%22%3A5%2C%22vc%22%3A11%7D%2C%22num_visible_units%22%3A11%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_7&__rev=1538717&__adt=7");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=AXiPlphY5F8Sjmr5&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A1388563200%2C%22end%22%3A1420099199%2C%22query_type%22%3A8%2C%22filter_after_timestamp%22%3A1416415349%2C%22page_index%22%3A2%2C%22section_container_id%22%3A%22u_jsonp_6_1%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_year_current%22%2C%22unit_container_id%22%3A%22u_jsonp_6_0%22%2C%22current_scrubber_key%22%3A%22year_2014%22%2C%22buffer%22%3A500%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Afalse%2C%22tipld%22%3A%7B%22sc%22%3A16%2C%22rc%22%3A5%2C%22vc%22%3A30%7D%2C%22num_visible_units%22%3A30%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_8&__rev=1538717&__adt=8");
                pageletList.Add("https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=AXiPlphY5F8Sjmr5&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A1388563200%2C%22end%22%3A1420099199%2C%22query_type%22%3A8%2C%22filter_after_timestamp%22%3A1416415349%2C%22page_index%22%3A3%2C%22section_container_id%22%3A%22u_jsonp_6_1%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_year_current%22%2C%22unit_container_id%22%3A%22u_jsonp_6_0%22%2C%22current_scrubber_key%22%3A%22year_2014%22%2C%22buffer%22%3A500%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Afalse%2C%22tipld%22%3A%7B%22sc%22%3A24%2C%22rc%22%3A5%2C%22vc%22%3A68%7D%2C%22num_visible_units%22%3A68%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=jsonp_9&__rev=1538717&__adt=9");
                foreach (string pageletUrl in pageletList)
                {
                    try
                    {
                        //string pageletUrl1 = "https://www.facebook.com/ajax/pagelet/generic.php/ProfileTimelineSectionPagelet?ajaxpipe=1&ajaxpipe_token=" + ajaxpipe_token + "&no_script_path=1&data=%7B%22profile_id%22%3A" + FriendId + "%2C%22start%22%3A0%2C%22end%22%3A1420099199%2C%22query_type%22%3A36%2C%22page_index%22%3A1%2C%22section_container_id%22%3A%22u_0_16%22%2C%22section_pagelet_id%22%3A%22pagelet_timeline_recent%22%2C%22unit_container_id%22%3A%22u_0_15%22%2C%22current_scrubber_key%22%3A%22recent%22%2C%22buffer%22%3A50%2C%22require_click%22%3Afalse%2C%22showing_esc%22%3Afalse%2C%22adjust_buffer%22%3Atrue%2C%22tipld%22%3A%7B%22sc%22%3A2%2C%22rc%22%3A5%2C%22vc%22%3A5%7D%2C%22num_visible_units%22%3A5%2C%22remove_dupes%22%3Atrue%7D&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxembzESu49UJ6K59poW8xHzoyfw&__req=jsonp_2&__rev=1538717&__adt=2";
                        string pageletUrl1Response = HttpHelper.getHtmlfromUrl(new Uri(pageletUrl));
                        string[] pageletUrl1html = System.Text.RegularExpressions.Regex.Split(pageletUrl1Response, "feedbacktargets");
                        string postid1 = string.Empty;
                        foreach (string html in pageletUrl1html)
                        {
                            if (html.Contains("targetfbid"))
                            {
                                try
                                {
                                    postid1 = Utils.getBetween(html, "targetfbid\":\"", "\",\"entidentifier");
                                    lstPostsId.Add(postid1);
                                }
                                catch (Exception ex)
                                {
                                    postid1 = Utils.getBetween(html,"targetfbid\":\"","\"");
                                    lstPostsId.Add(postid1);
                                    GlobusLogHelper.log.Error(ex.Message);
                                }
                            }

                        }

                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error(ex.Message);
                    }
                }
                lstPostsId = lstPostsId.Distinct().ToList();

                if (NoOfPostFanPageLikercount > lstPostsId.Count)
                {
                    foreach (string post in lstPostsId)
                    {
                        try
                        {
                            string likePostData = "like_action=true&ft_ent_identifier=" + post + "&source=1&client_id=1419011576345%3A3587685310&rootid=u_jsonp_9_g&ft[tn]=%3E]&ft[fbfeed_location]=10&nctr[_mod]=pagelet_timeline_year_current&av=" + __user + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=21&fb_dtsg=" + fb_dtsg + "&ttstamp=265816911712210666955511773100&__rev=1538717";
                            string postDataResp = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/ufi/like.php"), likePostData);
                            GlobusLogHelper.log.Info("Like Post Id " + post);
                            GlobusLogHelper.log.Debug("Like Post Id " + post);
                            try
                            {
                                int ran = new Random().Next(minDelayFanPageLiker, maxDelayFanPageLiker);
                                GlobusLogHelper.log.Info("Delaying For " + ran);
                                GlobusLogHelper.log.Debug("Delaying For " + ran);
                                Thread.Sleep(ran*1000);
                                
                            }
                            catch { }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(ex.Message);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < NoOfPostFanPageLikercount; i++)
                    {
                        try
                        {
                            string likePostData = "like_action=true&ft_ent_identifier=" + lstPostsId[i] + "&source=1&client_id=1419011576345%3A3587685310&rootid=u_jsonp_9_g&ft[tn]=%3E]&ft[fbfeed_location]=10&nctr[_mod]=pagelet_timeline_year_current&av=" + __user + "&__user="******"&__a=1&__dyn=7nmajEyl2qm9udDgDxyIGzGpUW9ACxO4p9GgyimEVFLFwxBxe-bzESu49UJ6K59poW8xHzoyfw&__req=21&fb_dtsg=" + fb_dtsg + "&ttstamp=265816911712210666955511773100&__rev=1538717";
                            string postDataResp = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/ufi/like.php"), likePostData);
                            GlobusLogHelper.log.Info("Like Post Id " + lstPostsId[i]);
                            GlobusLogHelper.log.Debug("Like Post Id " + lstPostsId[i]);
                            try
                            {

                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error(ex.Message);
                            }
                            try
                            {
                                int ran = new Random().Next(minDelayFanPageLiker, maxDelayFanPageLiker);
                                GlobusLogHelper.log.Info("Delaying For " + ran);
                                GlobusLogHelper.log.Debug("Delaying For " + ran);
                                Thread.Sleep(ran*1000);

                            }
                            catch { }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error(ex.Message);
                        }
                    
                    }
                
                }
                GlobusLogHelper.log.Info("Finish Like Posts  with " + FriendUrl);
                GlobusLogHelper.log.Debug("Finish Like Post  with " + FriendUrl);
            }
         
        }
예제 #24
0
        /// <summary>
        /// StartPostLiker add by ajay kumar yadav  23/12/2013
        /// </summary>
        /// <param name="fbUser"></param>
        


        public void StartPostLiker(ref FacebookUser fbUser)
        {
            GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
            try
            {
                string fb_dtsg = "";
                string __user = "";
                string strEventURLPageSource = "";
                string ft_ent_identifier = string.Empty;
                string Username = fbUser.username;


                foreach (string item in lstFanPageUrlCollectionCommentLiker)
                {

                    try
                    {
                        strEventURLPageSource = HttpHelper.getHtmlfromUrl(new Uri(item));
                        try
                        {
                            __user = GlobusHttpHelper.GetParamValue(strEventURLPageSource, "user");
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {

                            if (string.IsNullOrEmpty(__user))
                            {
                                __user = GlobusHttpHelper.ParseJson(strEventURLPageSource, "user");
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }

                        try
                        {
                            fb_dtsg = GlobusHttpHelper.Get_fb_dtsg(strEventURLPageSource);
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        try
                        {
                            ft_ent_identifier = item.Substring(item.IndexOf("posts/"), item.Length - item.IndexOf("posts/")).Replace("posts/", string.Empty).Trim();
                            ft_ent_identifier = ft_ent_identifier.Replace("?","&&");
                            if (ft_ent_identifier.Contains("&&"))
                            {
                                string[] arr = System.Text.RegularExpressions.Regex.Split(ft_ent_identifier, "&&");
                                ft_ent_identifier=arr[0];
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }

                        if (string.IsNullOrEmpty(ft_ent_identifier))
                        {
                            ft_ent_identifier = Utils.getBetween(strEventURLPageSource,"ftentidentifier","instanceid").Replace("\"","").Replace(":","").Replace(",","");
                        }

                     
                        string postData = "like_action=true&ft_ent_identifier=" + ft_ent_identifier + "&source=2&client_id=1357365511041%3A1142013411&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&__req=5&fb_dtsg=" + fb_dtsg + "&phstamp=1658168106858611353174";
                        string response = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PagePagePosterAjaxUfiLikePhp), postData);   
                                                                                                                                           
                        if (response.Contains("error"))
                        {
                            try
                            {
                                string[] summaryArr = Regex.Split(response, "errorSummary\":");
                                summaryArr = Regex.Split(summaryArr[1], "\"");
                                string errorSummery = summaryArr[1];
                                string errorDiscription = summaryArr[5];

                                GlobusLogHelper.log.Info("PostId:" + ft_ent_identifier + " Error Summary : " + errorSummery + " And Error Description :" + errorDiscription + "  With UserName : "******"PostId:" + ft_ent_identifier + " Error Summary : " + errorSummery + " And Error Description :" + errorDiscription + "  With UserName : "******"Error : " + ex.StackTrace);
                            }
                        }
                        else
                        {
                            GlobusLogHelper.log.Debug("Liked PostId : " + ft_ent_identifier + " with UserName : "******" for URL : " + item);
                            GlobusLogHelper.log.Info("Liked PostId : " + ft_ent_identifier + " with UserName : "******" for URL : " + item);

                            // Save Data Into CSV File
                            try
                            {
                                string CSVHeader = "User_Name" + "," + "PostId" + ", " + "PostURL";
                                string CSV_Content = Username + "," + ft_ent_identifier + ", " + item;
                                //FBApplicationData.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.Path_PhotoLikerDetails);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            try
                            {
                                int delayInSeconds = Utils.GenerateRandom(minDelayFanPagePoster * 1000, maxDelayFanPagePoster * 1000);
                                GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }

                GlobusLogHelper.log.Debug("Process Completed With User Name : " + Username);
                GlobusLogHelper.log.Info("Process Completed With User Name : " + Username);
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #25
0
 private static bool ExtractKeyword_idsFbforOffSet(ref FacebookUser fbUser, ref string userid, int offset)
 {
     GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
     bool boolValue = false;
     try
     {
         string pagesourceofsnippet_idforoffset = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/search/ajax/more.php?offsets[pps]=" + offset.ToString() + "&pagesize=20&q=ipl&type=all&init=quick&__a=1&__user="******"displayed"))
         {
             boolValue = true;
             return boolValue;
         }
         else
         {
             boolValue = false;
             return boolValue;
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
     return boolValue;
 }
예제 #26
0
        private void StartActionPageInviter(ref FacebookUser fbUser)
        {
            try
            {
                //  FanPageInviter method

                FanPageInviter(ref fbUser);             
              
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #27
0
        public void CommentOnPost1(ref FacebookUser fbUser, List<string> lstFanpageURLs, List<string> lstFanpageMessages)
        {
            try
            {
                counter = 0;
                int CounterLikePost = 1;
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;
                string link_data = string.Empty;
                #region Post variable

                string post_form_id = string.Empty;
                string fbpage_id = string.Empty;
                string fb_dtsg = string.Empty;
                string __user = string.Empty;
                string xhpc_composerid = string.Empty;
                string xhpc_targetid = string.Empty;
                string xhpc_composerid12 = string.Empty;
                int NoOfEmailAccount = 20;
                string message = string.Empty;

                int noOfPosts = NoOfPostFanPageLikercount;
                List<string> arrftentidentifier_itemList = new List<string>();

                #endregion

                GlobusLogHelper.log.Info("Start Comment On Post  with " + fbUser.username);
                GlobusLogHelper.log.Debug("Start Comment On Post  with " + fbUser.username);

                //queFanPageURLsFanPageLiker.Clear();
                queFanPageMessagesFanPageLiker.Clear();

                //foreach (string item in lstFanpageURLs)
                //{
                //    PageManager.queFanPageURLsFanPageLiker.Enqueue(item);

                //}

                foreach (string item in lstFanpageMessages)
                {
                    PageManager.queFanPageMessagesFanPageLiker.Enqueue(item);
                }
                string FanpageUrl = "";//(string)paramArray.GetValue(6);

                string ResponseLogin = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl));
                __user = GlobusHttpHelper.GetParamValue(ResponseLogin, "user");
                if (string.IsNullOrEmpty(__user))
                {
                    __user = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
                }

                if (string.IsNullOrEmpty(__user) || __user == "0" || __user.Length < 3)
                {
                    GlobusLogHelper.log.Info("Please Check The Account : " + fbUser.username);
                    GlobusLogHelper.log.Debug("Please Check The Account : " + fbUser.username);
                    return;
                }
                int countMessagePost = 0;
                string pageSource1 = ResponseLogin;
                // Again started the processs . Use goto for that statement.
                StartAgain:
                //JS, CSS, Image Requests
                //RequestsJSCSSIMG.RequestJSCSSIMG(pageSource1, ref HttpHelper);

                string Keys = string.Empty;
                string Dc = string.Empty;

                if (pageSource1.Contains("keys"))
                {
                    try
                    {
                        string strKeys = pageSource1.Substring(pageSource1.IndexOf("keys"), 30);
                        string[] Arrfb_dtsg = strKeys.Split(':');
                        Keys = Arrfb_dtsg[1];
                        Arrfb_dtsg = Keys.Split(']');
                        Keys = Arrfb_dtsg[0];

                        Keys = Keys.Replace("[", "");
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }

                if (pageSource1.Contains("dc="))
                {
                    try
                    {
                        string strDc = pageSource1.Substring(pageSource1.IndexOf("dc="), 30);
                        string[] Arrfb_dtsg = strDc.Split('=');
                        strDc = Arrfb_dtsg[1];
                        Arrfb_dtsg = strDc.Split('\\');
                        strDc = Arrfb_dtsg[0];
                        Dc = strDc;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                }
                if (ResponseLogin.Contains("fb_dtsg"))
                {
                    fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");
                }
                if (ResponseLogin.Contains("post_form_id"))
                {
                    post_form_id = GlobusHttpHelper.GetParamValue(ResponseLogin, "post_form_id");
                }

                int wallFilterNo = 2;
                if (LikeOthersPosts)
                {
                    wallFilterNo = 3;
                }
             
                bool isTimeLine = false;
                int page_index = 0;
                int segment_index = 0;
                int start = 0;
                int end = 1406876399;
                int section_index = 0;
                int query_type = 36;
                while (countMessagePost < noOfPosts)  // noOfPosts //foreach (string lstFanPageURLsitem in lstFanPageURLs)
                {
                    lock (lockrqueFanPageURLsFanPageLiker)
                    {
                        try
                        {
                            if (queFanPageURLsFanPageLiker.Count == 0)
                            {
                                Monitor.Wait(lockrqueFanPageURLsFanPageLiker, 1 * 1000 * 45); //Wait for 90 secs

                                if (queFanPageURLsFanPageLiker.Count == 0)
                                {
                                    GlobusLogHelper.log.Info("All URLs used up for posting");
                                    GlobusLogHelper.log.Debug("All URLs used up for posting");
                                     
                                   return;
                                }
                            }
                            FanpageUrl = queFanPageURLsFanPageLiker.Dequeue();
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    lock (lockrqueFanPageMessagesFanPageLiker)
                    {
                        try
                        {
                            if (lstFanPageCommentsFanPageLiker.Count >= 1)
                            {
                                if (queFanPageMessagesFanPageLiker.Count == 0)
                                {
                                    Monitor.Wait(lockrqueFanPageMessagesFanPageLiker, 1 * 1000 * 45); //Wait for 90 secs
                                    if (queFanPageMessagesFanPageLiker.Count == 0)
                                    {
                                        GlobusLogHelper.log.Info("All Messages used up for posting");
                                        GlobusLogHelper.log.Debug("All Messages used up for posting");
                                        return;
                                    }
                                }
                                message = queFanPageMessagesFanPageLiker.Dequeue();
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }


                    if (DiscardPostsFilterCommentsFanPageLiker)
                    {
                        wallFilterNo = 2;
                    }
                    //FanpageUrl = lstFanPageURLsitem;
                    for (int i = 1; i < wallFilterNo; i++)
                    {
                        try
                        {
                            if (FanpageUrl.Contains("?sk=wall"))
                            {
                                FanpageUrl = FanpageUrl.Remove(FanpageUrl.IndexOf("?sk=wall"));
                            }
                            //FanpageUrl = FanpageUrl.Replace("?sk=wall", "");
                            if (DiscardPostsFilterCommentsFanPageLiker)
                            {
                                FanpageUrl = FanpageUrl + "?sk=wall";
                            }
                            else
                            {
                                FanpageUrl = FanpageUrl + "?sk=wall&filter=" + i + "";
                            }
                            string wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FanpageUrl));               //HttpHelper.getHtmlfromUrlProxy(new Uri(FanpageUrl), proxyAddress, intProxyPort, proxyUserName, proxyPassword);

                            string[] ArrFrom = Regex.Split(wallPageSrc, "uiUnifiedStory uiStreamStory genericStreamStory aid_Array uiListItem uiListLight uiListVerticalItemBorder");
                            ArrFrom = Regex.Split(wallPageSrc, "timelineUnitContainer");
                            List<string> FanpgeData = new List<string>();
                            foreach (string itemFan in ArrFrom)
                            {
                                try
                                {
                                    if (!itemFan.Contains("<!DOCTYPE"))
                                    {
                                        if (itemFan.Contains("/form"))
                                        {
                                            try
                                            {
                                                string tempFan = itemFan;
                                                tempFan = tempFan.Substring(0, tempFan.IndexOf("/form"));
                                                //FanpgeData.Add(tempFan);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            if (ArrFrom.Length == 1)
                            {
                                isTimeLine = true;
                                ArrFrom = Regex.Split(wallPageSrc, "<li ");
                                foreach (string itemFan in ArrFrom)
                                {
                                    try
                                    {
                                        if (!itemFan.Contains("<!DOCTYPE"))
                                        {
                                            if (itemFan.Contains("fbTimelineUnit fbTimelineTwoColumn clearfix") || itemFan.Contains("fbTimelineUnit lastCapsule fbTimelineTwoColumn clearfix") || itemFan.Contains("fbTimelineUnit firstUnit fbTimelineTwoColumn clearfix") || itemFan.Contains("fbTimelineUnit firstUnit lastCapsule fbTimelineTwoColumn clearfix"))
                                            {
                                                //FanpgeData.Add(itemFan);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            //Code changes made by Lijo
                            string pageID = string.Empty;
                            string profile_id = string.Empty;
                            string timeline_log_data = string.Empty;

                            try
                            {
                                pageID = Utils.getBetween(wallPageSrc, "pageID", "pagelets").Replace("\"", "").Replace(":", "").Replace(",", "");
                            }
                            catch { };

                            try
                            {
                                profile_id = Utils.getBetween(wallPageSrc, "profile_id=", "&amp");
                            }
                            catch { };
                            string HomePageSource = wallPageSrc;
                            wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.fbhomeurl + pageID));
                            string[] ArrFrom1 = Regex.Split(wallPageSrc, "PagePostsSectionPagelet-" + pageID.ToString() + "-0");
                            if (ArrFrom1[2].Contains("/posts/"))
                            {
                                string[] ArrTemp = Regex.Split(ArrFrom1[2], "/posts/");
                                foreach (string itemFan in ArrTemp)
                                {
                                    try
                                    {
                                        if (!itemFan.Contains("<div class=\"_1k4h _5ay5\">"))
                                        {
                                            try
                                            {
                                                string tempFan = itemFan;
                                                tempFan = itemFan.Substring(0, itemFan.IndexOf("\""));
                                                tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty);
                                                FanpgeData.Add(tempFan);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            if (ArrFrom1[2].Contains("target_fbid="))
                            {
                                string[] ArrTemp = Regex.Split(ArrFrom1[2], "target_fbid=");
                                foreach (string itemFan in ArrTemp)
                                {
                                    try
                                    {
                                        if (!itemFan.Contains("<div class=\"_1k4h _5ay5\">"))
                                        {
                                            try
                                            {
                                                string tempFan = itemFan;
                                                tempFan = itemFan.Substring(0, itemFan.IndexOf("\""));
                                                tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty);
                                                FanpgeData.Add(tempFan);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            if (ArrFrom1[2].Contains("story_fbid="))
                            {
                                string[] ArrTemp = Regex.Split(ArrFrom1[2], "story_fbid=");
                                foreach (string itemFan in ArrTemp)
                                {
                                    try
                                    {
                                        if (!itemFan.Contains("<div class=\"_1k4h _5ay5\">"))
                                        {
                                            try
                                            {
                                                string tempFan = itemFan;
                                                tempFan = itemFan.Substring(0, itemFan.IndexOf("&"));
                                                tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty);
                                                FanpgeData.Add(tempFan);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                }
                            }
                            int count = 0;
                            while (true)
                            {

                                wallPageSrc = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/ajax/pagelet/generic.php/PagePostsSectionPagelet?data=%7B%22segment_index%22%3A" + segment_index.ToString() + "%2C%22page_index%22%3A" + page_index.ToString() + "%2C%22page%22%3A" + pageID + "%2C%22column%22%3A%22main%22%2C%22post_section%22%3A%7B%22profile_id%22%3A" + profile_id + "%2C%22start%22%3A" + start.ToString() + "%2C%22end%22%3A" + end.ToString() + "%2C%22query_type%22%3A" + query_type.ToString() + "%2C%22filter%22%3A1%2C%22is_pages_redesign%22%3Atrue%7D%2C%22section_index%22%3A" + section_index.ToString() + "%2C%22hidden%22%3Afalse%2C%22posts_loaded%22%3A" + count.ToString() + "%2C%22show_all_posts%22%3Afalse%7D&__user="******"&__a=1&__dyn=7n8ahyj2qm9udDgDxyKAEWy6zECiq78hACF3qGEVFLFwxBxCbzESu49UJ0&__req=9&__rev=1330171%20HTTP/1.1"));
                                if (wallPageSrc.Contains("/posts\\/") || wallPageSrc.Contains("story_fbid=") || wallPageSrc.Contains("target_fbid="))
                                {
                                    ArrFrom1 = Regex.Split(wallPageSrc, "timelineUnitContainer");
                                    foreach (string itemFan in ArrFrom1)
                                    {
                                        try
                                        {

                                            if (!itemFan.Contains("for (;;)"))
                                            {
                                                if (itemFan.Contains("/posts\\/"))
                                                {
                                                    try
                                                    {
                                                        string tempFan = itemFan;
                                                        //tempFan = tempFan.Substring(2, tempFan.IndexOf("\\\""));
                                                        tempFan = Utils.getBetween(tempFan, "/posts\\/", "\"");
                                                        tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty);
                                                        if (!FanpgeData.Contains(tempFan) && !tempFan.Equals(""))
                                                        {
                                                            count++;
                                                        }
                                                        FanpgeData.Add(tempFan);
                                                        FanpgeData = FanpgeData.Distinct().ToList();

                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                                else if (itemFan.Contains("target_fbid="))
                                                {
                                                    try
                                                    {
                                                        string tempFan = itemFan;
                                                        //tempFan = tempFan.Substring(tempFan.IndexOf("target_fbid="), tempFan.IndexOf("\\\""));
                                                        tempFan = Utils.getBetween(tempFan, "target_fbid=", "\\\"");

                                                        tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty);
                                                        if (!FanpgeData.Contains(tempFan) && !tempFan.Equals(""))
                                                        {
                                                            count++;
                                                        }
                                                        FanpgeData.Add(tempFan);
                                                        FanpgeData = FanpgeData.Distinct().ToList();
                                                        FanpgeData.Remove("");
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                                else if (itemFan.Contains("story_fbid="))
                                                {
                                                    try
                                                    {
                                                        string tempFan = itemFan;
                                                        //tempFan = tempFan.Substring(0, tempFan.IndexOf("&"));
                                                        tempFan = Utils.getBetween(tempFan, "story_fbid=", "&");
                                                        tempFan = tempFan.Replace("&amp", string.Empty).Replace("&id", string.Empty).Replace("=", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty);
                                                        if (!FanpgeData.Contains(tempFan) && !tempFan.Equals(""))
                                                        {
                                                            count++;
                                                        }
                                                        FanpgeData.Add(tempFan);
                                                        FanpgeData = FanpgeData.Distinct().ToList();
                                                        //count++;
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }
                                    segment_index++;
                                    if (FanpgeData.Count >= noOfPosts)
                                    {
                                        break;
                                    }
                                }
                                else
                                {

                                    page_index++;
                                    segment_index = 0;
                                    if (page_index > 1)
                                    {
                                        page_index = 0;
                                        start = 1388563200;
                                        end = end + 13222800;
                                        section_index = 1;
                                        query_type = 8;
                                        count = 0;
                                    }
                                }
                            }
                            FanpgeData = FanpgeData.Distinct().ToList();
                            if (lstFanpageMessages.Count < noOfPosts)
                            {
                                queFanPageMessagesFanPageLiker.Clear();
                                int remaining = FanpgeData.Count-lstFanpageMessages.Count;
                                for(int c =0;c<remaining;c++)
                                {
                                    lstFanpageMessages.Add(lstFanpageMessages[c]);
                                }
                                foreach (string item in lstFanpageMessages)
                                {
                                    PageManager.queFanPageMessagesFanPageLiker.Enqueue(item);
                                }
                            }
                            string feedback_params = string.Empty;
                            #region Commented Code
                            //#region Non Timeline
                            //if (!isTimeLine)
                            //{
                            //    int tempCounter_LikeSelected = 0;

         
                            //    foreach (string item in FanpgeData)
                            //    {
                            //        try
                            //        {
                            //            message = queFanPageMessagesFanPageLiker.Dequeue();

                            //            if (countMessagePost >= noOfPosts)
                            //            {
                            //                GlobusLogHelper.log.Info("Process accomplished with : " + fbUser.username);
                            //                GlobusLogHelper.log.Debug("Process accomplished with : " + fbUser.username);

                            //                return;
                            //            }

                            //            //string itemModified = item;
                            //            if (item.Contains(">View Post<"))
                            //            {
                            //                //itemModified =  
                            //            }
                            //            string item111 = item.Replace("\\\"", "\"");

                            //            if (!item.Contains("\\\" data-gt="))
                            //            {
                            //                int startIndx = item.IndexOf("data-ft=\"&#123;") + "data-ft=\"&#123;".Length;
                            //                int endIndx = item.IndexOf("&#125;", startIndx);

                            //                link_data = item.Substring(startIndx, endIndx - startIndx).Replace("&quot;", "\"");
                            //                link_data = "{" + link_data + "}";
                            //                link_data = Uri.EscapeDataString(link_data);

                            //                // string timeline_log_data = string.Empty;
                            //                timeline_log_data = GlobusHttpHelper.GetParamValue(item, "timeline_log_data");


                            //                //string feedback_params = string.Empty;
                            //                feedback_params = GlobusHttpHelper.GetParamValue(item, "feedback_params");

                            //                if (!string.IsNullOrEmpty(feedback_params))
                            //                {
                            //                    try
                            //                    {
                            //                        timeline_log_data = GlobusHttpHelper.GetParamValue(item, "timeline_log_data").Replace("&quot;", "\"");
                            //                        timeline_log_data = timeline_log_data.Replace("&#123;", "");
                            //                        timeline_log_data = timeline_log_data.Replace("&#125;", "");
                            //                        timeline_log_data = "{" + timeline_log_data + "}";
                            //                        timeline_log_data = Uri.EscapeDataString(timeline_log_data);
                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }
                            //                }
                            //                if (!string.IsNullOrEmpty(feedback_params))
                            //                {
                            //                    try
                            //                    {
                            //                        feedback_params = GlobusHttpHelper.GetParamValue(item, "feedback_params").Replace("&quot;", "\"");
                            //                        feedback_params = feedback_params.Replace("&#123;", "");
                            //                        feedback_params = feedback_params.Replace("&#125;", "");
                            //                        feedback_params = "{" + feedback_params + "}";
                            //                        feedback_params = Uri.EscapeDataString(feedback_params);
                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }
                            //                }
                            //                else
                            //                {
                            //                    continue;
                            //                }

                            //            }
                            //            else
                            //            {
                            //                int startIndx = item111.IndexOf("data-ft=\"&#123;") + "data-ft=\"&#123;".Length;
                            //                int endIndx = item111.IndexOf("&#125;", startIndx);

                            //                link_data = item111.Substring(startIndx, endIndx - startIndx).Replace("&quot;", "\"");
                            //                link_data = "{" + link_data + "}";
                            //                link_data = Uri.EscapeDataString(link_data);


                            //                timeline_log_data = GlobusHttpHelper.GetParamValue(item111, "timeline_log_data");



                            //                feedback_params = GlobusHttpHelper.GetParamValue(item111, "feedback_params");

                            //                if (!string.IsNullOrEmpty(feedback_params))
                            //                {
                            //                    try
                            //                    {
                            //                        timeline_log_data = GlobusHttpHelper.GetParamValue(item111, "timeline_log_data").Replace("&quot;", "\"");
                            //                        timeline_log_data = timeline_log_data.Replace("&#123;", "");
                            //                        timeline_log_data = timeline_log_data.Replace("&#125;", "");
                            //                        timeline_log_data = "{" + timeline_log_data + "}";
                            //                        timeline_log_data = Uri.EscapeDataString(timeline_log_data);
                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }
                            //                }
                            //                if (!string.IsNullOrEmpty(feedback_params))
                            //                {
                            //                    try
                            //                    {
                            //                        feedback_params = GlobusHttpHelper.GetParamValue(item111, "feedback_params").Replace("&quot;", "\"");
                            //                        feedback_params = feedback_params.Replace("&#123;", "");
                            //                        feedback_params = feedback_params.Replace("&#125;", "");
                            //                        feedback_params = "{" + feedback_params + "}";
                            //                        feedback_params = Uri.EscapeDataString(feedback_params);
                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }
                            //                }
                            //                else
                            //                {
                            //                    continue;
                            //                }
                            //            }


                            //            if (LikeSelectedFanPageLiker)
                            //            {
                            //                tempCounter_LikeSelected++;
                            //                if (!lstLikeSelectedFanPageLiker.Contains(tempCounter_LikeSelected))
                            //                {
                            //                    continue;
                            //                }
                            //            }



                            //            string ftentidentifier = string.Empty;

                            //            ///Like
                            //            ///Delay
                            //            string postResponse = string.Empty;
                            //            try
                            //            {
                            //                // Thread.Sleep(10 * 1000);

                            //                ///By Ajay y Due to Post data change...
                            //                if (CounterLikePost == 2)
                            //                {
                            //                    if (wallPageSrc.Contains("ftentidentifier"))
                            //                    {
                            //                        try
                            //                        {
                            //                            string[] arrftentidentifier = Regex.Split(wallPageSrc, "ftentidentifier");
                            //                            if (arrftentidentifier.Count() > 10)
                            //                            {

                            //                                foreach (var arrftentidentifier_item in arrftentidentifier)
                            //                                {
                            //                                    ftentidentifier = arrftentidentifier_item.Substring(arrftentidentifier_item.IndexOf(":"), (arrftentidentifier_item.IndexOf(",", arrftentidentifier_item.IndexOf(":")) - arrftentidentifier_item.IndexOf(":"))).Replace(":", string.Empty).Replace("}", "").Replace("\"", string.Empty).Trim();
                            //                                    arrftentidentifier_itemList.Add(ftentidentifier);
                            //                                    arrftentidentifier_itemList = arrftentidentifier_itemList.Distinct().ToList();

                            //                                }
                            //                                ftentidentifier = arrftentidentifier_itemList[counter];
                            //                                counter = counter + 1;
                            //                            }
                            //                            else
                            //                            {
                            //                                try
                            //                                {
                            //                                    if (arrftentidentifier[counter].Count() > 1)
                            //                                    {
                            //                                        if (arrftentidentifier[counter].Contains(":"))
                            //                                        {
                            //                                            ftentidentifier = arrftentidentifier[counter].Substring(arrftentidentifier[counter].IndexOf(":"), (arrftentidentifier[counter].IndexOf(",", arrftentidentifier[counter].IndexOf(":")) - arrftentidentifier[counter].IndexOf(":"))).Replace(":", string.Empty).Replace("}", "").Replace("\"", string.Empty).Trim();
                            //                                            counter = counter + 1;
                            //                                            if (Convert.ToInt32(ftentidentifier)==1)
                            //                                            {
                            //                                                continue;
                            //                                            }
                            //                                        }
                            //                                    }
                            //                                }
                            //                                catch (Exception)
                            //                                {
                            //                                }
                            //                            }
                            //                        }
                            //                        catch (Exception ex)
                            //                        {
                            //                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                        }
                            //                    }
                            //                }
                            //                else
                            //                {
                            //                    if (HomePageSource.Contains("ftentidentifier"))
                            //                    {
                            //                        List<string> ftentidentifierList = new List<string>();
                            //                        try
                            //                        {
                            //                            string[] arrftentidentifier = Regex.Split(HomePageSource, "ftentidentifier");

                            //                            foreach (var arrftentidentifier_item in arrftentidentifier)
                            //                            {
                            //                                try
                            //                                {
                            //                                    if (!arrftentidentifier_item.Contains("<!DOCTYPE html>"))
                            //                                    {
                            //                                        ftentidentifier = arrftentidentifier_item.Substring(arrftentidentifier_item.IndexOf(":"), (arrftentidentifier_item.IndexOf(",", arrftentidentifier_item.IndexOf(":")) - arrftentidentifier_item.IndexOf(":"))).Replace(":", string.Empty).Replace("\"", string.Empty).Replace("}", "").Trim();
                            //                                        ftentidentifierList.Add(ftentidentifier);
                            //                                        ftentidentifierList = ftentidentifierList.Distinct().ToList();
                            //                                    }

                            //                                }
                            //                                catch { };

                            //                            }
                            //                            #region MyRegion
                            //                            //try
                            //                            //{
                            //                            //    if (arrftentidentifier[counter].Count() > 1)
                            //                            //    {
                            //                            //        if (arrftentidentifier[counter].Contains(":"))
                            //                            //        {
                            //                            //            ftentidentifier = arrftentidentifier[counter].Substring(arrftentidentifier[counter].IndexOf(":"), (arrftentidentifier[counter].IndexOf(",", arrftentidentifier[counter].IndexOf(":")) - arrftentidentifier[counter].IndexOf(":"))).Replace(":", string.Empty).Replace("\"", string.Empty).Trim();
                            //                            //            counter = counter + 1;
                            //                            //        }
                            //                            //    }
                            //                            //}
                            //                            //catch (Exception)
                            //                            //{
                            //                            //} 
                            //                            #endregion

                            //                            ftentidentifier = ftentidentifierList[CounterLikePost];
                            //                            CounterLikePost = CounterLikePost + 1;
                            //                        }
                            //                        catch (Exception ex)
                            //                        {
                            //                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                        }
                            //                    }
                            //                }

                            //                #region MyRegion
                            //                ////string postData1 = "__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816798981224510745"; //__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=165816798981224510745

                            //                ////string postResponse1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse1 + ftentidentifier + "&comment_from=" + __user + "&seen_user_fbids=true"), postData1);
                            //                ////string postResponse3 = string.Empty;

                            //                ////string postData2 = "like_action=true&ft_ent_identifier=" + ftentidentifier + "&source=0&&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=265817255451007849104778751";
                            //                ////postResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse2), postData2);

                            //                //Commneted By ajay yadav
                                       
                            //                //string postData1 = "__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816798981224510745"; //__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=165816798981224510745
                            //                //string postResponse1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse1 + ftentidentifier + "&comment_from=" + __user + "&seen_user_fbids=true"), postData1);

                            //                //string postData2 = "like_action=true&ft_ent_identifier=" + ftentidentifier + "&source=0&&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=1658167989812245107166";//like_action=true&ft_ent_identifier=348874178538877&source=0&client_id=1347961309895%3A42929564&ft[tn]=%3E%3D&ft[type]=20&__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=1658167989812245107166
                            //                //string postResponse2 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse2), postData2);


                            //                //string postData = "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&post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&feedback_params=" + feedback_params + "&translate_on_load=&add_comment_text=&link_data=" + link_data + "&like=&nctr[_mod]=pagelet_wall&lsd&post_form_id_source=AsyncRequest&__user="******"&phstamp=16581671017311289701051&has_reposts_bar=1&translate_on_load";
                            //                //postResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse), postData); 
                            //                #endregion
                            //            }
                            //            catch (Exception ex)
                            //            {
                            //                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //            }

                            //            if (wallPageSrc.Contains("setAdsTracking"))
                            //            {
                            //                try
                            //                {
                            //                    string setAdsTracking = wallPageSrc.Substring(wallPageSrc.IndexOf("setAdsTracking"), (wallPageSrc.IndexOf("}]]]}", wallPageSrc.IndexOf("setAdsTracking")) - wallPageSrc.IndexOf("setAdsTracking"))).Replace("setAdsTracking", string.Empty).Trim();
                            //                    string[] arrsetAdsTracking = Regex.Split(setAdsTracking, ":");
                            //                    foreach (string item1 in arrsetAdsTracking)
                            //                    {
                            //                        try
                            //                        {
                            //                            if (item1.Length > 30)
                            //                            {
                            //                                try
                            //                                {
                            //                                    string partRequest = string.Empty;
                            //                                    if (item1.Contains(","))
                            //                                    {
                            //                                        partRequest = item1.Substring(0, item1.IndexOf(",")).Replace("\"", string.Empty).Trim();
                            //                                    }
                            //                                    else
                            //                                    {
                            //                                        partRequest = item1.Replace("\"", string.Empty).Trim();
                            //                                    }
                            //                                    string response = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerFanPageLikerGetResponse + partRequest));
                            //                                }
                            //                                catch (Exception ex)
                            //                                {
                            //                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                                }
                            //                            }
                            //                        }
                            //                        catch (Exception ex)
                            //                        {
                            //                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                        }
                            //                    }
                            //                }
                            //                catch (Exception ex)
                            //                {
                            //                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                }
                            //            }
                            //            if (postResponse.Contains("Security Check Required"))
                            //            {
                            //                bool IsLoginError = true;
                            //                string content = fbUser.username + ":" + fbUser.password;

                            //                GlobusLogHelper.log.Info("Security Check Required " + FanpageUrl + "  with " + fbUser.username);
                            //                GlobusLogHelper.log.Debug("Security Check Required " + FanpageUrl + "  with " + fbUser.username);


                            //                lock (lockrqueFanPageURLsFanPageLiker)
                            //                {
                            //                    queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                            //                    Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                            //                }

                            //                lock (lockrqueFanPageMessagesFanPageLiker)
                            //                {
                            //                    queFanPageMessagesFanPageLiker.Enqueue(message);
                            //                    Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                            //                }

                            //                return;
                            //            }
                            //            countMessagePost++;
                            //            TotalFanPagelikeCounter++;

                            //            //GlobusLogHelper.log.Info(countMessagePost + " Like with " + fbUser.username + " on Wall : " + FanpageUrl);
                            //            //GlobusLogHelper.log.Debug(countMessagePost + " Like with " + fbUser.username + " on Wall : " + FanpageUrl);

                            //            #region MyRegion
                            //            //Comment
                            //            if (!string.IsNullOrEmpty(message))
                            //            {

                            //                string postDataComment = "ft_ent_identifier=" + ftentidentifier + "&comment_text=" + message + "&source=0&client_id=1351148351031%3A2449121619&reply_fbid&parent_comment_id&timeline_log_data=" + timeline_log_data + "&ft[tn]=[]&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816610967529969716";
                            //                string commentResponse1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostcommentResponse), postDataComment);

                            //                //&confirmed=1
                            //                string postDataComment1 = "ft_ent_identifier=" + ftentidentifier + "&comment_text=" + message + "&source=0&client_id=1351148351031%3A2449121619&reply_fbid&parent_comment_id&timeline_log_data=" + timeline_log_data + "&ft[tn]=[]&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816610967529969716&confirmed=1";
                            //                string commentResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostcommentResponse), postDataComment1);

                            //                if (wallPageSrc.Contains("setAdsTracking"))
                            //                {
                            //                    try
                            //                    {
                            //                        string setAdsTracking = wallPageSrc.Substring(wallPageSrc.IndexOf("setAdsTracking"), (wallPageSrc.IndexOf("}]]]}", wallPageSrc.IndexOf("setAdsTracking")) - wallPageSrc.IndexOf("setAdsTracking"))).Replace("setAdsTracking", string.Empty).Trim();
                            //                        string[] arrsetAdsTracking = Regex.Split(setAdsTracking, ":");
                            //                        foreach (string item1 in arrsetAdsTracking)
                            //                        {
                            //                            try
                            //                            {
                            //                                if (item1.Length > 30)
                            //                                {
                            //                                    try
                            //                                    {
                            //                                        string partRequest = string.Empty;
                            //                                        if (item1.Contains(","))
                            //                                        {
                            //                                            partRequest = item1.Substring(0, item1.IndexOf(",")).Replace("\"", string.Empty).Trim();
                            //                                        }
                            //                                        else
                            //                                        {
                            //                                            partRequest = item1.Replace("\"", string.Empty).Trim();
                            //                                        }
                            //                                        string response = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerFanPageLikerGetResponse + partRequest));
                            //                                    }
                            //                                    catch (Exception ex)
                            //                                    {
                            //                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                                    }
                            //                                }
                            //                            }
                            //                            catch (Exception ex)
                            //                            {
                            //                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                            }
                            //                        }
                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }
                            //                }

                            //            if (commentResponse.Contains("errorSummary") && commentResponse.Contains("Not Logged In"))
                            //            {
                            //                string summary = string.Empty;
                            //                try
                            //                {
                            //                    summary = GlobusHttpHelper.ParseJson(commentResponse, "errorSummary");
                            //                    string errorDescription = GlobusHttpHelper.ParseJson(commentResponse, "errorDescription");

                            //                    GlobusLogHelper.log.Info("Error Description: " + errorDescription + " with : " + fbUser.username);
                            //                    GlobusLogHelper.log.Debug("Error Description: " + errorDescription + " with : " + fbUser.username);

                            //                }
                            //                catch (Exception ex)
                            //                {
                            //                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                }


                            //                lock (lockrqueFanPageURLsFanPageLiker)
                            //                {
                            //                    queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                            //                    Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                            //                }

                            //                lock (lockrqueFanPageMessagesFanPageLiker)
                            //                {
                            //                    queFanPageMessagesFanPageLiker.Enqueue(message);
                            //                    Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                            //                }

                            //                return;

                            //            }
                            //                if (commentResponse.Contains("errorSummary"))
                            //                {
                            //                    try
                            //                    {
                            //                        string summary = GlobusHttpHelper.ParseJson(commentResponse, "errorSummary");
                            //                        string errorDescription = GlobusHttpHelper.ParseJson(commentResponse, "errorDescription");

                            //                        GlobusLogHelper.log.Info("Posting Error: " + summary + " | Error Description: " + errorDescription + " with: " + fbUser.username);
                            //                        GlobusLogHelper.log.Debug("Posting Error: " + summary + " | Error Description: " + errorDescription + " with: " + fbUser.username);

                            //                    }
                            //                    catch (Exception ex)
                            //                    {
                            //                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //                    }

                            //                    lock (lockrqueFanPageURLsFanPageLiker)
                            //                    {
                            //                        queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                            //                        Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                            //                    }

                            //                    lock (lockrqueFanPageMessagesFanPageLiker)
                            //                    {
                            //                        queFanPageMessagesFanPageLiker.Enqueue(message);
                            //                        Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                            //                    }

                            //                    //countMessagePost++;
                            //                    continue;
                            //                }


                            //                GlobusLogHelper.log.Info("Posted on " + (countMessagePost) + " comments with " + fbUser.username + " on Wall : " + FanpageUrl);
                            //                GlobusLogHelper.log.Debug("Posted on " + (countMessagePost) + " comments with " + fbUser.username + " on Wall : " + FanpageUrl);

                            //                //countMessagePost++;

                            //                //Write to csv
                            //                string CSVHeader = "UserName" + "," + "FanpageUrl" + "Message";
                            //                string CSV_Content = fbUser.username + "," + FanpageUrl + "," + message.Replace(",", ";");

                            //                //CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LikedComments);
                            //            } 
                            //            #endregion
                            //        }
                            //        catch
                            //        {

                            //            try
                            //            {
                            //                lock (lockrqueFanPageURLsFanPageLiker)
                            //                {
                            //                    queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                            //                    Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                            //                }

                            //                lock (lockrqueFanPageMessagesFanPageLiker)
                            //                {
                            //                    queFanPageMessagesFanPageLiker.Enqueue(message);
                            //                    Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                            //                }
                            //            }
                            //            catch (Exception ex)
                            //            {
                            //                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            //            }
                            //        }

                            //        int delayInSeconds1 = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                            //        GlobusLogHelper.log.Info("Delaying for " + delayInSeconds1 / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds1 / 1000 + " Seconds With UserName : "******"All Messages used up for posting");
                                                            GlobusLogHelper.log.Debug("All Messages used up for posting");
                                                            return;
                                                        }
                                                    }
                                                    message = queFanPageMessagesFanPageLiker.Dequeue();
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        
                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                    }
                                    try
                                    {
                                        if (countMessagePost >= noOfPosts)
                                        {
                                            GlobusLogHelper.log.Info("Process accomplished with : " + fbUser.username);
                                            return;
                                        }

                                        // string link_data = string.Empty;

                                        try
                                        {
                                            int startIndx = item.IndexOf("data-ft=\"&#123;") + "data-ft=\"&#123;".Length;
                                            int endIndx = item.IndexOf("&#125;", startIndx);
                                            link_data = item.Substring(startIndx, endIndx - startIndx).Replace("&quot;", "\"");
                                            link_data = "{" + link_data + "}";
                                            link_data = Uri.EscapeDataString(link_data);
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        //string modifiedItem = "name=\"feedback_params" + item;
                                        //  string feedback_params = string.Empty;
                                        feedback_params = GlobusHttpHelper.GetParamValue(item, "feedback_params");
                                        if (!string.IsNullOrEmpty(feedback_params))
                                        {
                                            try
                                            {
                                                feedback_params = GlobusHttpHelper.GetParamValue(item, "feedback_params").Replace("&quot;", "\"");
                                                feedback_params = feedback_params.Replace("&#123;", "");
                                                feedback_params = feedback_params.Replace("&#125;", "");
                                                feedback_params = "{" + feedback_params + "}";
                                                feedback_params = Uri.EscapeDataString(feedback_params);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        //  string timeline_log_data = string.Empty;
                                        timeline_log_data = GlobusHttpHelper.GetParamValue(item, "timeline_log_data");
                                        if (!string.IsNullOrEmpty(feedback_params))
                                        {
                                            try
                                            {
                                                timeline_log_data = GlobusHttpHelper.GetParamValue(item, "timeline_log_data").Replace("&quot;", "\"");
                                                timeline_log_data = timeline_log_data.Replace("&#123;", "");
                                                timeline_log_data = timeline_log_data.Replace("&#125;", "");
                                                timeline_log_data = "{" + timeline_log_data + "}";
                                                timeline_log_data = Uri.EscapeDataString(timeline_log_data);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        if (string.IsNullOrEmpty(timeline_log_data))
                                        {
                                            //continue;
                                        }

                                        if (LikeSelectedFanPageLiker)
                                        {
                                            tempCounter_LikeSelected++;
                                            if (!lstLikeSelectedFanPageLiker.Contains(tempCounter_LikeSelected))
                                            {
                                                //continue;
                                            }
                                        }

                                        string ftentidentifier = string.Empty;
                                        string postResponse = string.Empty;
                                        ///Like
                                        try
                                        {
                                            //Thread.Sleep(10 * 1000);
                                            ///By Ajay Due to Post data change...

                                            if (wallPageSrc.Contains("ftentidentifier"))
                                            {
                                                try
                                                {
                                                    string[] arrftentidentifier = Regex.Split(wallPageSrc, "ftentidentifier");
                                                    if (arrftentidentifier.Count() > 1)
                                                    {
                                                        if (arrftentidentifier[1].Contains(":"))
                                                        {
                                                            ftentidentifier = arrftentidentifier[1].Substring(arrftentidentifier[1].IndexOf(":"), (arrftentidentifier[1].IndexOf(",", arrftentidentifier[1].IndexOf(":")) - arrftentidentifier[1].IndexOf(":"))).Replace(":", string.Empty).Replace("\"", string.Empty).Trim();
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }
                                            try
                                            {
                                                string postData1 = "__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816798981224510745"; //__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=165816798981224510745
                                                string postResponse1 = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse1 + item + "&comment_from=" + __user + "&seen_user_fbids=true"), postData1);

                                                //string postData2 = "like_action=true&ft_ent_identifier=" + ftentidentifier + "&source=0&&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=1658167989812245107166";//like_action=true&ft_ent_identifier=348874178538877&source=0&client_id=1347961309895%3A42929564&ft[tn]=%3E%3D&ft[type]=20&__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=1658167989812245107166
                                                string postData2 = "like_action=true&ft_ent_identifier=" + item + "&source=0&&ft[tn]=%3E%3D&ft[type]=20&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=16581668085704579248";//like_action=true&ft_ent_identifier=348874178538877&source=0&client_id=1347961309895%3A42929564&ft[tn]=%3E%3D&ft[type]=20&__user=100004223172781&__a=1&fb_dtsg=AQCbbz-k&phstamp=1658167989812245107166

                                                postResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostpostResponse2), postData2);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error :" + ex.StackTrace);
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }

                                        if (wallPageSrc.Contains("setAdsTracking"))
                                        {
                                            try
                                            {
                                                string setAdsTracking = wallPageSrc.Substring(wallPageSrc.IndexOf("setAdsTracking"), (wallPageSrc.IndexOf("}]]]}", wallPageSrc.IndexOf("setAdsTracking")) - wallPageSrc.IndexOf("setAdsTracking"))).Replace("setAdsTracking", string.Empty).Trim();
                                                string[] arrsetAdsTracking = Regex.Split(setAdsTracking, ":");
                                                foreach (string item1 in arrsetAdsTracking)
                                                {
                                                    try
                                                    {
                                                        if (item1.Length > 30)
                                                        {
                                                            try
                                                            {
                                                                string partRequest = string.Empty;
                                                                if (item1.Contains(","))
                                                                {
                                                                    partRequest = item1.Substring(0, item1.IndexOf(",")).Replace("\"", string.Empty).Trim();
                                                                }
                                                                else
                                                                {
                                                                    partRequest = item1.Replace("\"", string.Empty).Trim();
                                                                }
                                                                string response = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerFanPageLikerGetResponse + partRequest));
                                                            }
                                                            catch (Exception ex)
                                                            {
                                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                            }
                                                        }
                                                    }
                                                    catch (Exception ex)
                                                    {
                                                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                    }
                                                }
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }
                                        if (postResponse.Contains("Security Check Required"))
                                        {
                                            bool IsLoginError = true;
                                            string content = fbUser.username + ":" + fbUser.password;
                                            GlobusLogHelper.log.Info("Security Check Required " + FanpageUrl + "  with " + fbUser.username);

                                            lock (lockrqueFanPageURLsFanPageLiker)
                                            {
                                               //queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                                                Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                                            }

                                            lock (lockrqueFanPageMessagesFanPageLiker)
                                            {
                                                //queFanPageMessagesFanPageLiker.Enqueue(message);
                                                Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                                            }

                                            return;
                                        }
                                        countMessagePost++;
                                        TotalFanPagelikeCounter++;
                                        if (countMessagePost > NoOfPostFanPageLikercount)
                                        {
                                            break;
                                        }

                                        GlobusLogHelper.log.Info(countMessagePost + " Like with " + fbUser.username + " on Wall : " + FanpageUrl);
                                        GlobusLogHelper.log.Debug(countMessagePost + " Like with " + fbUser.username + " on Wall : " + FanpageUrl);


                                        ///Comment
                                        if (!string.IsNullOrEmpty(message))
                                        {

                                            string postDataComment = "ft_ent_identifier=" + item + "&comment_text=" + message + "&source=0&client_id=1351148351031%3A2449121619&reply_fbid&parent_comment_id&timeline_log_data=" + timeline_log_data + "&ft[tn]=[]&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=165816610967529969716";
                                            string commentResponse = HttpHelper.postFormData(new Uri(FBGlobals.Instance.PageManagerFanPageLikerPostcommentResponse), postDataComment);

                                            if (wallPageSrc.Contains("setAdsTracking"))
                                            {
                                                try
                                                {
                                                    string setAdsTracking = wallPageSrc.Substring(wallPageSrc.IndexOf("setAdsTracking"), (wallPageSrc.IndexOf("}]]]}", wallPageSrc.IndexOf("setAdsTracking")) - wallPageSrc.IndexOf("setAdsTracking"))).Replace("setAdsTracking", string.Empty).Trim();
                                                    string[] arrsetAdsTracking = Regex.Split(setAdsTracking, ":");
                                                    foreach (string item1 in arrsetAdsTracking)
                                                    {
                                                        try
                                                        {
                                                            if (item1.Length > 30)
                                                            {
                                                                try
                                                                {
                                                                    string partRequest = string.Empty;
                                                                    if (item1.Contains(","))
                                                                    {
                                                                        partRequest = item1.Substring(0, item1.IndexOf(",")).Replace("\"", string.Empty).Trim();
                                                                    }
                                                                    else
                                                                    {
                                                                        partRequest = item1.Replace("\"", string.Empty).Trim();
                                                                    }
                                                                    string response = HttpHelper.getHtmlfromUrl(new Uri(FBGlobals.Instance.PageManagerFanPageLikerGetResponse + partRequest));
                                                                }
                                                                catch (Exception ex)
                                                                {
                                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                                }
                                                            }
                                                        }
                                                        catch (Exception ex)
                                                        {
                                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                            }

                                            if (commentResponse.Contains("errorSummary") && commentResponse.Contains("Not Logged In"))
                                            {
                                                //FanPagePosterLogger("Not Logged in with : " + Username);
                                                bool IsLoginError = true;
                                                string summary = string.Empty;
                                                try
                                                {
                                                    summary = GlobusHttpHelper.ParseJson(commentResponse, "errorSummary");
                                                    string errorDescription = GlobusHttpHelper.ParseJson(commentResponse, "errorDescription");
                                                    GlobusLogHelper.log.Info("Error Description: " + errorDescription + " with : " + fbUser.username);
                                                    GlobusLogHelper.log.Debug("Error Description: " + errorDescription + " with : " + fbUser.username);
                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }
                                                lock (lockrqueFanPageURLsFanPageLiker)
                                                {
                                                    queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                                                    Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                                                }
                                                lock (lockrqueFanPageMessagesFanPageLiker)
                                                {
                                                    queFanPageMessagesFanPageLiker.Enqueue(message);
                                                    Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                                                }
                                                return;
                                            }
                                            if (commentResponse.Contains("errorSummary"))
                                            {
                                                try
                                                {
                                                    string summary = GlobusHttpHelper.ParseJson(commentResponse, "errorSummary");
                                                    string errorDescription = GlobusHttpHelper.ParseJson(commentResponse, "errorDescription");

                                                    GlobusLogHelper.log.Info("Posting Error: " + summary + " | Error Description: " + errorDescription + " with: " + fbUser.username);
                                                    GlobusLogHelper.log.Debug("Posting Error: " + summary + " | Error Description: " + errorDescription + " with: " + fbUser.username);

                                                }
                                                catch (Exception ex)
                                                {
                                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                                }

                                                lock (lockrqueFanPageURLsFanPageLiker)
                                                {
                                                   // queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                                                    Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                                                }

                                                lock (lockrqueFanPageMessagesFanPageLiker)
                                                {
                                                   // queFanPageMessagesFanPageLiker.Enqueue(message);
                                                    Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                                                }

                                                countMessagePost++;
                                                continue;
                                            }

                                            //Write to csv
                                            string CSVHeader = "UserName" + "," + "FanpageUrl" + "Message";
                                            string CSV_Content = fbUser.username + "," + FanpageUrl + "," + message.Replace(",", ";");
                                            //CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LikedComments);
                                            GlobusLogHelper.log.Info("Posted on " + (countMessagePost) + " comments with " + fbUser.username + " on Wall : " + FanpageUrl);
                                            GlobusLogHelper.log.Debug("Posted on " + (countMessagePost) + " comments with " + fbUser.username + " on Wall : " + FanpageUrl);

                                        
                                            //countMessagePost++;
                                        }
                                    }
                                    catch
                                    {
                                        try
                                        {
                                            lock (lockrqueFanPageURLsFanPageLiker)
                                            {
                                                //queFanPageURLsFanPageLiker.Enqueue(FanpageUrl);
                                                Monitor.Pulse(lockrqueFanPageURLsFanPageLiker);
                                            }

                                            lock (lockrqueFanPageMessagesFanPageLiker)
                                            {
                                              // queFanPageMessagesFanPageLiker.Enqueue(message);
                                                Monitor.Pulse(lockrqueFanPageMessagesFanPageLiker);
                                            }
                                        }
                                        catch (Exception ex)
                                        {
                                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                        }
                                    }


                                    int delayInSeconds1 = Utils.GenerateRandom(minDelayFanPageLiker * 1000, maxDelayFanPageLiker * 1000);
                                    GlobusLogHelper.log.Info("Delaying for " + delayInSeconds1 / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds1 / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #28
0
        public void FanPageInviter(ref FacebookUser fbUser)
        {
           
            try
            {
                GlobusHttpHelper HttpHelper = fbUser.globusHttpHelper;

                string Username = string.Empty;
                string Password = string.Empty;
                string UserId = string.Empty;
                List<string> listFriendId = new List<string>();

                GlobusLogHelper.log.Debug("Please Wait ..");
                GlobusLogHelper.log.Info("Please Wait..");

                Array paramArray = new object[10];
                string Userss = fbUser.username;

                foreach (var FanPageUrl_item in lstFanPageUrlCollectionFanPageInviter)
                {
                    try
                    {
                        string fb_dtsg = string.Empty;
                        string page_id = string.Empty;


                        try
                        {

                            string PageSourceanPageUrl = HttpHelper.getHtmlfromUrl(new Uri(FanPageUrl_item));

                            UserId = GlobusHttpHelper.GetParamValue(PageSourceanPageUrl, "user");
                            if (string.IsNullOrEmpty(UserId))
                            {
                                UserId = GlobusHttpHelper.ParseJson(PageSourceanPageUrl, "user");
                            }

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

                                return;
                            }

                            fb_dtsg = GlobusHttpHelper.GetParamValue(PageSourceanPageUrl, "fb_dtsg");
                            if (string.IsNullOrEmpty(fb_dtsg))
                            {
                                fb_dtsg = GlobusHttpHelper.ParseJson(PageSourceanPageUrl, "fb_dtsg");
                            }
                            string FanPageUrl = FanPageUrl_item;
                            page_id = GlobusHttpHelper.GetPageID(PageSourceanPageUrl, ref FanPageUrl);

                            //Find Friends ID List
                            int count_Friends = FriendInfoScraper.ExtractFriendCount(ref fbUser, UserId);

                            listFriendId.Clear();

                            GlobusLogHelper.log.Info("Please wait finding the friends ID...");
                            GlobusLogHelper.log.Debug("Please wait finding the friends ID...");

                            //List<string> lstFriends = FriendInfoScraper.ExtractFriendIdsFb(ref fbUser, ref HttpHelper, ref UserId, count_Friends);
                            List<string> lstFriends = new List<string>();
                            try
                            {
                                lstFriends = FBUtils.GetAllFriends(ref HttpHelper, UserId);
                                lstFriends = lstFriends.Distinct().ToList();
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            int CountSendInvite = 0;
                            foreach (var lstFriends_item in lstFriends)
                            {
                                try
                                {

                                    if (FanPageInviterNoOfFriendSendInviter <= CountSendInvite)
                                    {
                                        break;
                                    }

                                    string PostData = "page_id=" + page_id + "&invitee=" + lstFriends_item + "&action=send&ref=finch_about_build_audience&__user="******"&__a=1&__dyn=aJswFeyj2qm9a5k9VUgGhaiV925xSq78hACl5DlqUSS-CEy5pokAWCyaG8z8gKAqhB-fjw&__req=9&fb_dtsg="+fb_dtsg+"&ttstamp=265816911110311176851225611890&__rev=1363263";
                                    string PostUrl = FBGlobals.Instance.PageManagerFanPageInviter;                  // "https://www.facebook.com/ajax/pages/invite/send_single/";

                                    string response = HttpHelper.postFormDataSendInvite(new Uri(PostUrl), PostData);

                                    if (response.Contains("\"payload\":null,\"bootloadable\""))
                                    {
                                        CountSendInvite = CountSendInvite + 1;

                                        GlobusLogHelper.log.Debug(CountSendInvite + " : invitation Send : " + lstFriends_item + " with UserName : "******" for Fan Page Url : " + FanPageUrl_item);
                                        GlobusLogHelper.log.Info(CountSendInvite + " : invitation Send : " + lstFriends_item + " with UserName : "******" for Fan Page Url : " + FanPageUrl_item);



                                        try
                                        {
                                            int delayInSeconds = Utils.GenerateRandom(minDelayFanPageInviter * 1000, maxDelayFanPageInviter * 1000);
                                            GlobusLogHelper.log.Info("Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Delaying for " + delayInSeconds / 1000 + " Seconds With UserName : "******"Error : " + ex.StackTrace);
                                        }
                                    }
                                    else
                                    {
                                        Thread.Sleep(1000);
                                    }

                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }
                    
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #29
0
        public void cmpFanPageLikerLogin(string cmpName, string cmpProcess, string account, List<string> lstFanPageURLs, List<string> lstFanPageMessages, List<string> lstFanPageComments)
        {
            
            try
            {
                if (isStopCmpFanPageLiker)
                {
                    return;
                }
                try
                {
                    lstThreadCmpFanPageLiker.Add(Thread.CurrentThread);
                    lstThreadCmpFanPageLiker.Distinct();
                    Thread.CurrentThread.IsBackground = true;
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }

                if (account.Contains(":"))
                {
                    string[] AccArr = account.Split(':');
                    if (AccArr.Count() > 1)
                    {
                        try
                        {
                            string accountUser = string.Empty;
                            string accountPass = string.Empty;
                            string proxyAddress = string.Empty;
                            string proxyPort = string.Empty;
                            string proxyUserName = string.Empty;
                            string proxyPassword = string.Empty;
                            string status = string.Empty;

                            try
                            {
                                accountUser = account.Split(':')[0];
                                accountPass = account.Split(':')[1];
                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                                proxyUserName = account.Split(':')[4];
                                proxyPassword = account.Split(':')[5];
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }


                            FacebookUser objFacebookUser = new FacebookUser();
                            objFacebookUser.username = accountUser;
                            objFacebookUser.password = accountPass;
                            objFacebookUser.proxyip = proxyAddress;
                            objFacebookUser.proxyport = proxyPort;
                            objFacebookUser.proxyusername = proxyUserName;
                            objFacebookUser.proxypassword = proxyPassword;

                            if (!objFacebookUser.isloggedin)
                            {
                                GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();

                                objFacebookUser.globusHttpHelper = objGlobusHttpHelper;


                                //Login Process

                                Accounts.AccountManager objAccountManager = new AccountManager();


                                objAccountManager.LoginUsingGlobusHttp(ref objFacebookUser);
                            }

                            if (objFacebookUser.isloggedin)
                            {
                                // Call LikePage

                                StartCmpFanPageLikerProcess(ref objFacebookUser,cmpName,cmpProcess,account, lstFanPageURLs, lstFanPageMessages,lstFanPageComments);

                            }
                            else
                            {
                                GlobusLogHelper.log.Info("Couldn't Login With Username : "******"Couldn't Login With Username : "******"Error : " + ex.StackTrace);
                        }
                    }
                    else
                    {
                        GlobusLogHelper.log.Info("Account : " + account + " Not In Correct Format !");
                        GlobusLogHelper.log.Debug("Account : " + account + " Not In Correct Format !");

                        return ;
                    }
                }

                else
                {
                    GlobusLogHelper.log.Info("Account : " + account + " Not In Correct Format !");
                    GlobusLogHelper.log.Debug("Account : " + account + " Not In Correct Format !");

                    return ;
                }

               
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
예제 #30
0
 private void StartActionCommentLiker(ref FacebookUser fbUser)
 {
     try
     {
         PostOnFanPageCommentWithURLAndItsImage(ref fbUser);
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }