Download a website within jscript or vbscript?

Hi,

I've ripped a lot of CDs and the directory names are the release IDs from discogs.com (numeric values).

I've thought I could write a script function in jscript or vbscript which downloads the content of each release id (directory) from api.discogs.com/release/ into a string but I noticed that a simple download function is not supported within jscript and vbscript. (right?) ... I searched in this forum and googled around and only found "XmlHttpRequest" - but no example within DO.

I could write this in Perl but I've thought I want to start learning JavaScript ...

Any idea AND example how-to?

Thanks a lot

Sounds like a good script, make sure you share when you are done :slight_smile:.

Have a look at this script DO11: TheMovieDB Poster&Info Downloader V2.0. it does something very similar but for movies.
Miran used this code to download.

	var xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0");
	url = MovieDB_BaseUrl + "/configuration?api_key=" + MovieDB_APIKey
	xhr.open("GET", url, false);
	xhr.setRequestHeader("Accept", "application/json");
	xhr.send(null)

I wrote something like this in Perl for use with JRiver MediaCenter. It is my discogs.pl script:

yabb.jriver.com/interact/index.php?topic=87032.0

You're welcome to borrow any code from it you want, but of course its not vbscript or jscript. It uses the WWW::Discogs module (which is essentially all that you need), but does much more

[quote="MrC"]I wrote something like this in Perl for use with JRiver MediaCenter. It is my discogs.pl script:

yabb.jriver.com/interact/index.php?topic=87032.0

You're welcome to borrow any code from it you want, but of course its not vbscript or jscript. It uses the WWW::Discogs module (which is essentially all that you need), but does much more[/quote]

Thanks a lot,

I never tried JRiver but will do it (never heared about it !!!). I'm using Tag & Rename for tagging my WAV files.

I saw the Discogs Perl module.

I'll try all soon! :slight_smile:

[quote="wowbagger"]Sounds like a good script, make sure you share when you are done :slight_smile:.

Have a look at this script DO11: TheMovieDB Poster&Info Downloader V2.0. it does something very similar but for movies.
Miran used this code to download.

var xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0"); url = MovieDB_BaseUrl + "/configuration?api_key=" + MovieDB_APIKey xhr.open("GET", url, false); xhr.setRequestHeader("Accept", "application/json"); xhr.send(null) [/quote]

Thanks a lot! Exactly what I needed.

I tried the same code before (incl. with "XMLHttpRequest()") but it didn't work. Now it looks like the same code but I don't know where was the mistake. However ... :stuck_out_tongue:

getAjaxValues("http://api.discogs.com/release/5548068");

function getAjaxValues(webUrl)
{
  var xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0");
  var url = webUrl;
   xhr.open("GET", url, false);
   xhr.setRequestHeader("Accept", "application/json");
   xhr.send(null);
   var xmlText = xhr.responseText;
   DOpus.Output(xmlText);
}

Is there someone who can tell me how to load another .js library in the current running .js script of DO - like the "script" tag does it in HTML browsers?

I want to use jQuery (api.jquery.com/jQuery.parseJSON/).

Thanks a lot again!

Some of the ideas here might be worth pursuing: stackoverflow.com/questions/1368 ... cript-host