Beispiel #1
0
        protected virtual string GetNextUrl(SitecoreResponseInfo response)
        {
            var links = response.DocumentNode.SelectNodes("//a[@href]");

            if (links != null)
            {
                var localLinks =
                    links.Select(l => l.GetAttributeValue("href", "")).Where(l => l.StartsWith("/") && !l.EndsWith(".aspx")).ToArray();
                if (localLinks.Length > 0)
                {
                    return(localLinks[Randomness.Random.Next(0, localLinks.Length)]);
                }
            }

            return(null);
        }
Beispiel #2
0
        public void ExecuteActions()
        {
            var ctx = HttpContext.Current;

            if (ctx != null)
            {
                var requestInfo = HttpContext.Current.ColossusInfo();
                if (Tracker.Current != null && requestInfo != null)
                {
                    foreach (var action in RequestActions)
                    {
                        action.Execute(Tracker.Current, requestInfo);
                    }
                }

                var info = SitecoreResponseInfo.FromContext();
            }
        }