generateSnippet: capturing text from the server and displaying it.