here's my script to retrieve a radar image. the location of the file is:
could someone take a look to see if there's anything i'm doing wrong:
var socket = new TCPSocket();
var receivedData = "";
socket.onConnect = function() {
write("GET /data/nids/IND19_thumb_t.jpg” + " HTTP/1.0\r\n\r\n");
};
socket.onData = function() {
receivedData += read();
};
socket.onIOError = function (e) {
widget(“output”).label = "IOError " + e;
};
socket.onClose = function () {
// remove the HTTP information from the received data
var imageStartIndex = receivedData.indexOf("\r\n\r\n");
var bitmapData = receivedData.substring(imageStartIndex+4);
// make and display the image
var MyImage = new Image(bitmapData);
widget(“output”).setImage(MyImage);
};
socket.connect('icons.wunderground.com',80,3000);