size_t writeFunctionHandler(char *contents,size_t size,size_t nmemb,void *userdata) {
// size of the storedSize
static size_t storedSize = 0;
// the size of data available
size_t realSize = size * nmemb;
char *dataBuffer = (char *) userdata;
// realloc the buffer buffer
dataBuffer = realloc(dataBuffer,storedSize + realSize);
if (dataBuffer == NULL) {
printf("Could not allocate memory \n");
return 0;
}
// store the contents of realSize from last storedSize
memcpy(&(dataBuffer[storedSize]),contents,realSize);
storedSize += realSize;
return realSize;
}
size_t writeFunctionHandler(char *contents,size