Beispiel #1
0
        public static string GetFieldFilterIdsForPostData(string Responce, string FilterFiled)
        {
            string Data = string.Empty;
            try
            {

                ChilkatHttpHelpr objChilkatHttpHelpr = new ChilkatHttpHelpr();


                string[] data = System.Text.RegularExpressions.Regex.Split(Responce, FilterFiled);
                foreach (var item in data)
                {
                    if (item.StartsWith(":"))
                    {
                        string data2 = item.Substring(item.IndexOf(":{"), item.IndexOf("},") - item.IndexOf(":{")).Replace(":{", "").Trim();
                        Data = data2;

                        List<string> hrefLink = objChilkatHttpHelpr.GetHrefFromString(Data);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            return Data;
        }
Beispiel #2
0
        public void DataParserAjax(string response, ref FacebookUser fbUser)
        {
            try
            {
                try
                {
                    string Response = response;
                    ChilkatHttpHelpr objChilkat = new ChilkatHttpHelpr();

                    string FirstPgaeName = string.Empty;
                    string SecondPgaeName = string.Empty;
                    string otherPgaeName = string.Empty;



                    string PageTitle = string.Empty;
                    string PageTitleLink = string.Empty;

                    string SourceTitle = string.Empty;
                    string SourceTitleLink = string.Empty;

                    string memberCount = string.Empty;

                    string FirstPgaeNameLink = string.Empty;
                    string SecondPgaeNameLink = string.Empty;
                    string otherPgaeNameLink = string.Empty;

                    string likerData = string.Empty;
                    string SecondlikerData = string.Empty;
                    string ThirdlikerData = string.Empty;


                    bool MemberPage = false;
                    Response = Response.Replace("\\", "").Replace("u003C", "<");

                    string[] DataList = System.Text.RegularExpressions.Regex.Split(Response, "<div class=\"");
                    foreach (string item2 in DataList)
                    {

                        #region Title

                        if (item2.Contains("&quot;title&quot"))
                        {
                            List<string> hrefLink = objChilkat.GetHrefFromString(item2);

                            try
                            {

                                string titleData = item2.Substring(item2.IndexOf("\"><a") + 5);
                                string DataPage = GetSbstringData(titleData, "\">", "<");

                                PageTitle = DataPage;
                                PageTitleLink = hrefLink[0].ToString();


                            }
                            catch { };


                        }



                        #endregion


                        #region GroupSource

                        if (item2.Contains("quot;sub_headers&quot"))
                        {
                            List<string> hrefLink = objChilkat.GetHrefFromString(item2);

                            try
                            {

                                string titleData = item2.Substring(item2.IndexOf("\"><a") + 5);
                                string DataPage = GetSbstringData(titleData, "\">", "<");

                                SourceTitle = DataPage;
                                if (hrefLink.Count() > 0)
                                {
                                    SourceTitleLink = hrefLink[0].ToString();
                                }


                            }
                            catch { };


                        }



                        #endregion


                        # region Memebers
                        if (item2.Contains("members") && item2.Count() < 150 && MemberPage == false)
                        {
                            MemberPage = true;
                            try
                            {
                                string MemeberData = GetSbstringData(item2, "\">", "<").Replace("members", "").Replace(",", "");
                                memberCount = MemeberData;
                            }
                            catch { };


                        }
                        #endregion


                    }

                    string Username = string.Empty;
                    if (!string.IsNullOrEmpty(PageTitle))
                    {
                        string data = PageTitleLink.Substring(0, PageTitleLink.IndexOf("?"));

                        Username = data.Split('/')[3];

                        // Username = PageTitle + " : " + PageTitleLink;
                    }


                    string Likes = string.Empty;
                    if (!string.IsNullOrEmpty(FirstPgaeName))
                    {
                        //Likes ="Likes "+ FirstPgaeName + " : " + FirstPgaeNameLink;
                        Likes = "Likes " + FirstPgaeNameLink;
                    }
                    if (!string.IsNullOrEmpty(SecondPgaeName))
                    {
                        // Likes = Likes + " and " + SecondPgaeName + " : " + SecondPgaeNameLink;
                        Likes = Likes + " and " + SecondPgaeNameLink;
                    }
                    if (!string.IsNullOrEmpty(otherPgaeName))
                    {
                        // Likes = Likes + " and " + otherPgaeName + " : " + otherPgaeNameLink;
                        Likes = Likes + " and " + otherPgaeNameLink;
                    }



                    if (Username.Count() > 5)
                    {
                        try
                        {
                            string FollowerData = string.Empty;
                            string FileData = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\FBScraperGroupData\\SearchUrlUserId.txt";
                            if (!File.Exists(FileData))
                            {
                                try
                                {
                                    string DataHeader = " UserId " + "\t" + " Likes " + "\t" + " Studied In " + " \\t " + " Listens " + " \\t " + "Followers" + "\\t " + "Watches";

                                    GlobusFileHelper.AppendStringToTextfileNewLine(DataHeader, exportFilePathAccountVerification + "\\NoOptionForConfirmationEmailResend.txt");
                                }
                                catch { };
                            }

                            //string Data = MainUrl + "\t" + Username.Replace(",", "") + "\t" + Likes.Replace(",", "") + "\t" + studyData.Replace(",", "") + "\t" + Listens.Replace(",", "") + "\t" + FollowerData.Replace(",", "") + " \\t " + Watches.Replace(",", "");



                            //AppendStringToTextFileNewLine(Data, FileData);
                        }
                        catch { };
                    }


                }
                catch { };



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