Example #1
0
        private void HandleLinks(WebPageState state)
        {
            Match m = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.Content);

            while (m.Success)
            {
                ManualProcessorLinksCounter++;
                m = m.NextMatch( );
            }
        }
Example #2
0
        private void HandleLinks(WebPageState state)
        {
            string html = state.Content;
            Match  m    = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, html);

            while (m.Success)
            {
                m_spider.AddWebPage(state.Uri, m.Groups["url"].ToString( ));

                m = m.NextMatch( );
            }
        }
        public void VehiclesFeaturesTest()
        {
            Log(TestPH1);
            var ptxt = RegExUtil.RegExClean(TestPH1);

            ptxt = RegExUtil.Prepare(ptxt);
            Log(ptxt);
            var cur = CreateCursor(ptxt);

            cur.ProcessReplace <VFeat>(CancellationToken.None);
            Log(cur.ToString());
        }
        private void GraphicsLinkHandler(WebPageState state)
        {
            Match  m = RegExUtil.GetMatchRegEx(RegularExpression.SrcExtractor, state.content_);
            string image;

            while (m.Success)
            {
                m     = m.NextMatch();
                image = m.Groups[1].ToString();

                statusBar.Text = "Image: " + image;
                Application.DoEvents();

                DownloadImage(image);
            }
        }
        public void HandleLinks(WebPageState state)
        {
            if (state.processInstructions_.IndexOf("Handle Links") != -1)
            {
                int   counter = 0;
                Match m       = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.content_);

                while (m.Success)
                {
                    if (AddWebPage(state.uri_, m.Groups["url"].ToString()))
                    {
                        counter++;
                    }

                    m = m.NextMatch();
                }
            }
        }
Example #6
0
        public void HandleLinks(WebPageState state)
        {
            if (state.ProcessInstructions.IndexOf("Handle Links") != -1)
            {
                int   counter = 0;
                Match m       = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.Content);

                while (m.Success)
                {
                    if (AddWebPage(state.Uri, m.Groups["url"].ToString( )))
                    {
                        counter++;
                    }

                    m = m.NextMatch( );
                }

                Console.WriteLine("           : {0} new links were added", counter);
            }
        }
 public IActionResult SignUp([FromBody] UserInfo user)
 {
     try
     {
         if (user == null)
         {
             return(BadRequest("Invalid request"));
         }
         if (!(user.UserEmailId?.Length > 0) || !(user.Password?.Length > 0))
         {
             throw new Exception("Email address and password are mandatory");
         }
         if (!RegExUtil.IsMatch(user.UserEmailId, RegExUtil.EMAIL_ID_FORMAT))
         {
             throw new Exception("Invalid Email address");
         }
         var userInfoDataOperations = new UserInfoDBOperations(_context);
         if (userInfoDataOperations.checkIfUserExists(user))
         {
             throw new Exception("User already exists");
         }
         else
         {
             return(Ok(userInfoDataOperations.SaveUserInfo(user)));
         }
     }
     catch (Exception ex)
     {
         var res = new CustomHttpErrorResponse()
         {
             StatusCode   = HttpStatusCode.ExpectationFailed,
             ErrorMessage = ex.Message
         };
         return(Ok(res));
     }
 }