| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Net.ApiService;
- namespace Speech {
- static class simple_say {
- [Route("/say.cgi")]
- public static object Say(RequestHeader r) {
- if (!String.IsNullOrEmpty(r.Request("say"))) {
- System.Diagnostics.Debug.WriteLine("I try to say: " + r.Query["say"]);
- if (!String.IsNullOrEmpty(r.Request("mood"))) {
- SpeechExecute.Say(r.Request("say"));
- } else {
- SpeechExecute.Say(r.Request("say"));
- }
- return new Leah.SayResponse("ok", "");
- } else {
- System.Diagnostics.Debug.WriteLine("I try to say: ");
- return new Leah.SayResponse("failed", "");
- }
- }
- [Route("test.html")]
- public static string test(RequestHeader r) {
- return "<html><head><title>Test</title></head><body>Hallo <strong>du</strong> da</body></html>";
- }
- [Route("say_([a-zA-Z0-9_]+).cgi")]
- public static object SayIt(RequestHeader r, Match mc) {
- System.Diagnostics.Debug.WriteLine("SayIt: " + mc.Groups[1].Value);
- return new Leah.SayResponse("ok","");
- }
- /*[Route("topic.cgi")]
- public static string topic(RequestHeader r) {
- string t = r.Request("topic");
- string m = r.Request("mood");
- if (t != "") {
- string res = "";
-
- return res;
- }
- }*/
- }
- }
|