Beispiel #1
0
        public override string Fetch(DataRow dr)
        {
            Initialize(dr, true, new SPMConfig()
            {
                AcceptAllCertificatePolicy = true, Expect100Continue = false
            });
            string message = String.Empty;
            string output  = String.Empty;

            Result <string> fields = Validate();

            if (fields.IsValid)
            {
                WebSearch webSearch             = new WebSearch(provider);
                Result <IRestResponse> response = webSearch.Execute();

                if (response.IsValid)
                {
                    WebParse        webParse    = new WebParse();
                    Result <string> parseResult = webParse.Execute(response.Value);

                    if (parseResult.IsValid)
                    {
                        HandleModes(response.Value.Content, webParse);

                        output = parseResult.Value;
                    }
                    else
                    {
                        message = parseResult.Message;
                    }
                }
                else
                {
                    message = response.Message;
                }
            }
            else
            {
                message = fields.Message;
            }


            return(ProcessResults(output, message));
        }