Created
September 17, 2009 13:17
-
-
Save kuenishi/188483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* test_hook.c : dynamic library with a callback function for julius; | |
who inputs result of speech recognition. the result will be redirected | |
to twitter CLI client and posted to twitter.com. */ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int | |
get_plugin_info(int opcode, char *buf, int buflen) | |
{ | |
switch(opcode) { | |
case 0: | |
strncpy(buf, "simple output plugin", buflen); | |
break; | |
} | |
return 0; | |
} | |
void | |
result_best_str(char *result_str) // this char * should be raw char encoding, basically \ | |
EUC-JP. | |
{ | |
char str[256]; | |
//printf( " < %s >\n ", result_str ); | |
if (result_str == NULL) { | |
printf("¥t[failed]¥n"); | |
} else { | |
sprintf(str, "python post_to_twitter.py %s", result_str); | |
// sprintf(str, "python echo_test.py %s", result_str); | |
system(str); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment