Skip to content

Instantly share code, notes, and snippets.

@kuenishi
Created September 17, 2009 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuenishi/188483 to your computer and use it in GitHub Desktop.
Save kuenishi/188483 to your computer and use it in GitHub Desktop.
/* 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