--- /dev/null
+CC = g++
+
+LIBS = `pkg-config rest --libs`
+
+FLAGS = `pkg-config rest --cflags`
+
+gtranslate: gtranslate.o
+ $(CC) -o gtranslate gtranslate.o $(LIBS)
+
+gtranslate.o: gtranslate.cpp
+ $(CC) -c gtranslate.cpp $(FLAGS)
+
+all: gtranslate
+
+clean:
+ rm -rf gtranslate gtranslate.o *~
--- /dev/null
+#include <iostream>
+#include <rest/rest/rest-proxy.h>
+#include <glib.h>
+#include <unistd.h>
+
+using namespace std;
+
+int main(int argc, char **argv)
+{
+ GError *error = NULL;
+ RestProxy *proxy;
+ RestProxyCall *call;
+ GMainLoop *loop;
+ const gchar *payload;
+ const char *text;
+ gssize len;
+
+ g_thread_init (NULL);
+ g_type_init ();
+
+ if (argc>1)
+ {
+ text=argv[1];
+ }
+ else
+ {
+ text="Hola Mundo";
+ }
+
+ proxy = rest_proxy_new ("http://ajax.googleapis.com/ajax/services/language/translate", FALSE);
+ call = rest_proxy_new_call (proxy);
+
+ rest_proxy_call_add_params (call,
+ "v", "1.0",
+ "q", text,
+ "langpair", "es|en",
+ NULL);
+ rest_proxy_call_run (call, NULL, NULL);
+
+ payload = rest_proxy_call_get_payload (call);
+ len = rest_proxy_call_get_payload_length (call);
+ write (1, payload, len);
+ cout << endl;
+
+ g_object_unref (call);
+ g_object_unref (proxy);
+}