Hi There.
I am trying to use libCurl to copy the contents of a webpage into a string in C.
This is what I have so far:
void Cmd_translate_f (char *message)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, va("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s!&langpair=en|fr"),message);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
res = curl_easy_perform(curl);
}
}
The function takes a string and then uses the google translating service to translate it. I am, however, unaware of how to copy the contents of the received webpage into a c string. All this code does at the moment is print out the contents.
Many Thanks :)