Example #1
0
        public Dictionary <string, HttpResponseMessage> CheckLinks(Uri uri)
        {
            var results = new Dictionary <string, HttpResponseMessage>();

            try
            {
                List <Uri> urisFromWithinPageOfMainUri = _linkGetter.GetUrisOutOfPageFromMainUri(uri);
                results = CheckUrisHttpStatus(urisFromWithinPageOfMainUri);
            }
            catch (HttpRequestException hre)
            {
                Console.WriteLine($"HttpRequestException Error for {uri}");
                Console.WriteLine(hre);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error for {uri}");
                Console.WriteLine(ex);
            }

            return(results);
        }
        public JsonResult GetLinksFromRepo(string uri)
        {
            List <Uri> linksFromRepo = _linkGetter.GetUrisOutOfPageFromMainUri(new Uri(uri));

            return(Json(linksFromRepo.Select(uri => uri.AbsoluteUri)));
        }