Marc , i made your script to work with Google.
The problem is how to define the size of the pictures? If you can help me with this?
I think you should also include this in your script?
this.download = function() {
if (p.artist == "" || p.artist == "?") return;
this.working = true;
var folder = this.folder + "\\";
if (!this.xmlhttp) this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
this.xmlhttp.open("GET", "https://www.google.com/search?q=" + encodeURIComponent(p.artist) + "/&sei=GAKAUuvmD-WC4gTL9IC4AQ&gbv=2&tbm=isch", true);
this.xmlhttp.send();
this.xmlhttp.onreadystatechange = function() {
if (im.xmlhttp.readyState == 4) {
if (im.xmlhttp.status == 200) {
var text = im.xmlhttp.responsetext;
if (!im.doc) im.doc = new ActiveXObject("htmlfile");
im.doc.open();
var div = im.doc.createElement("div");
div.innerHTML = text;
var data = div.getElementsByTagName("img");
var urls = [];
for (i = 0; i < data.length; i++) {
if (data[i].src.indexOf("https://encrypted-tbn2.gstatic.com/images?q=tbn:") == 0) urls.push(data[i].src.replace(":", ":"));
}
for (i = 0; i < Math.min(urls.length, im.limit, 50); i++) {
p.WshShell.Run("cscript //nologo \"" + p.script_path + "download.vbs\" \"" + urls[i] + "\" \"" + [folder + i] + urls[i].substring(urls[i].lastIndexOf(":")+1) + ".jpg" + "\"" , 0, true);
}
im.working = false;
im.doc.close();
im.update();
window.NotifyOthers("images", "update");
} else {
p.console("HTTP error: " + im.xmlhttp.status + urls);
}
}
}
}