I usually get three reports of successfull communication (the LED toggles 3 times) but on the fourth (sometimes 3rd) the LED stays lit a LONG time, then the RED LED starts doing the SOS thing, and then the core resets, but it’s not this app that’s running.
The red LED SOS means that there was a panic. the number of flashes between SOS n-flashes SOS tells you the panic code.
I don't think you should be reading after you have called TCP.stop() since I think the buffers get flushed and reused. Try moving the stop() call down to after the while(count--) TCP.read(); loop.
Also one thing @Dave has been saying is to try putting a small delay after sendGetRequest() but before the while(!TCP.available()) loop. I have not found that to be needed but maybe it depends on your internet router etc. I call TCPClient.flush() at the end of the GET request on the assumption that I won't be interested in any bytes left in the buffer.
Finally I am assuming this part is just some kind of mistake and the bash junk is not really in your file since it wouldn't compile:
Is your LED flashing red with SOS (... --- ...) followed by 8 flashes in a row? I suspect you could be running out of heap memory. Have you thought about reducing the two 1k byte buffers? One of them appears to not be used. There is lots of buffering already going on in the TCP stream so you should try to minimize what you need to buffer.
Also I would not try to return a string from your GET request code. The string is already global, just null terminate it and you are done. You should null terminate it either way since you are likely running off the end of it.
bko is correct, you have some wasted RAM there. That by itself may fix your problem, but I would think the Spark Core should be able to allow 2KB of user RAM usage.