Example #1
0
        public IActionResult Index()
        {
            var request1 = GetReleases("https://opinionated-quotes-api.gigalixirapp.com/v1/quotes?tags=short&tmode=all");

            //var memes = JObject.Parse(request);
            var jObject = JObject.Parse(request1);
            var text0   = (string)jObject["quotes"][0]["quote"];
            /*ViewData["memes"] =*/
            //var data = (Memes)JsonConvert.DeserializeObject<Memes>((string)jObject["data"]["memes"]);

            /*Random rand = new Random();
             * int num = rand.Next(jObject["quotes"]["quote"]);
             * ViewData["memes"]= (string)jObject["data"]["memes"][num]["name"];
             * ViewData["url"] = (string)jObject["data"]["memes"][num]["url"];*/
            //ViewData["memes"] = request;
            var url     = "https://api.imgflip.com/caption_image?template_id=129242436&username=mexvance&password=Restapi1&text0=" + text0;
            var request = GetReleases(url);

            jObject         = JObject.Parse(request);
            ViewData["url"] = (string)jObject["data"]["url"];

            //Soap call
            var client  = new TextCasingSoapTypeClient(TextCasingSoapTypeClient.EndpointConfiguration.TextCasingSoap);
            var myQuote = client.AllLowercaseWithTokenAsync(text0, "");

            ViewData["memes"] = myQuote.Result.Body.AllLowercaseWithTokenResult.ToString();

            return(View());
        }
Example #2
0
        public async Task <IActionResult> InvertString(string invert)
        {
            var client   = new TextCasingSoapTypeClient(TextCasingSoapTypeClient.EndpointConfiguration.TextCasingSoap);
            var responce = await client.InvertCaseFirstAdjustStringToCurrentAsync(invert ?? "Please enter a string next time");

            ViewData["string"] = responce.Body.InvertCaseFirstAdjustStringToCurrentResult;
            return(View("invert"));
        }
Example #3
0
        public async Task <IActionResult> Index()
        {
            var client   = new TextCasingSoapTypeClient(TextCasingSoapTypeClient.EndpointConfiguration.TextCasingSoap);
            var response = await client.InvertCaseFirstAdjustStringToCurrentAsync("hello World");

            ViewData["string"] = response.Body.InvertCaseFirstAdjustStringToCurrentResult;

            return(View());
        }
Example #4
0
        public async Task <IActionResult> TextCasing(string word)
        {
            var client   = new TextCasingSoapTypeClient(TextCasingSoapTypeClient.EndpointConfiguration.TextCasingSoap);
            var response = await client.InvertStringCaseAsync(word);

            ViewData["InvertCase"] = response.Body.InvertStringCaseResult;

            return(View());
        }
Example #5
0
 public TextCasingSoapTypeClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(TextCasingSoapTypeClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Example #6
0
 public TextCasingSoapTypeClient(EndpointConfiguration endpointConfiguration) :
     base(TextCasingSoapTypeClient.GetBindingForEndpoint(endpointConfiguration), TextCasingSoapTypeClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }