mjm716, I generally get poor results from allmusic searches whenever I have parentheses or brackets in an album name, so per Romor's suggestions in post #422, I replace the following in the latest script to eliminate everything within and including trailing parentheses in what is used by the script without altering my files' tag fields. If you have brackets or leading parentheses in your album names, you can expand on concept by altering the second new line below:

Can you please tell why, when playing the album in *.flac, cover is not stored in a folder ? Biography of it is loaded, but it remains only an empty folder with the name of the album in folder album instead of the cover

Initially I was doing script for shoutcast streams with 7.html trick, but after testing later it turned out it was unnecessary because soon as stream track changes, biography view is notified about the change (dynamic artist and title), but I leave function commented at bottom as reference.So basically it is now showing selected last.fm info for provided artist and title, when such info may be desired and unknown, as while listening streamsIt also "exposes" MBIDs: artist_mbid, album_mbid and track_mbid, so can be tweaked trivially further

Usage: cscript //nologo foo_shout.vbs "%artist%" "%title%"

Example showing all info (artist short bio and album tracklisting can be disabled):

Can you please tell why, when playing the album in *.flac, cover is not stored in a folder ? Biography of it is loaded, but it remains only an empty folder with the name of the album in folder album instead of the cover

What if you do not use brackets? If %album% is empty it probably won't be queried anyway, so it's pointless to have those. If that doesn't help what if you use a static filename? Try these:

Works great - thanks for catching this and updating so quickly! I've learned a lot from the elegant approach you took with your May version, and the few changes needed to keep up with allmusic's latest changes certainly shows the flexibility of your script.

I am, quite honestly, fairly confused about how to set-up the 3 tabs under the last.fm section of Biography so that I can download album art.I've put some stuff in, and album art seems to be downloading into a folder in my Foobar2000 folder, but I'm not entirely sure if I'm doing this correctly.Here are the 3 tabs under last.fm for me.

I'm also curious as to whether the album art that is downloaded will transfer over to my iPod when synced.

Any help or advice would be appreciated.

EDIT: It seems that it's only downloading album art for albums I've visited. Is there any way to make it search through all my albums by itself?

I updated allmusic script yet again, this time to add new feature while rest stays simple as was

I added caching, as Biography View caching mechanism works just for built-in last.fm service, and dislike the idea of re-requesting while using HTML DOM object, for several reasonsNew version caches data in XML file (optional), located in folder where script is called from, with this kind of scheme:

Romor, my powers of observation failed me in not seeing with the script update last week that my biography panel was failing over to last.fm results rather than displaying allmusic results. I still think this is great work even if I can't determine at times when it's working or not!

Since I have a few mods to the basic script, I typically edit my script to add the changes and run it via a cmd window to get better feedback than available in the panel as I make changes, and once working in the cmd window, I try it in the panel and it works and I'm done. That process normally works well, except this time - I get different results from the same script running in the cmd window than with the panel!

More specifically, I never could get the unaltered version just before the caching change (which I named "17.vbs") to work. It bombs with the error message" 17.vbs(12, 5) Microsoft VBScript runtime error: Object required: 'content' "

...which seem fine. I tweaked them anyway to try to get beyond this error but just got other errors. I finally gave up and just ran it in the panel, and the panel does not error on this - it works just fine in the panel. I haven't tried the version with the caching capability, but given the nature of that change I don't expect any impact on this mystery.

I've never encountered a situation before where this (or any other) script works in either the cmd window or the panel, but not the other. I'm running Windows 7 32bit. Since the script works in the panel that's all that really matters, but if there is any explanation for this so I can rely on the cmd window results in the future, any explanation or advice is appreciated.

Try to dump HTM object output: "WScript.Echo HTM.body.innerHTML" before setting content and maybe deduce the problemIn any case, if script got to that point, you should have html with id="content" inside

Thanks for the tip - it was indeed erroring because there was nothing in HTM via the cmd window. A reboot seemed to solve it - very strange, but just glad the script continues to work great in the panel.

One of the mods I add is no longer effective given the website changes. With the previous website design, search results were paged, and I could search beyond the first page with a simple change. I have a number of albums that have common names ("Greatest Hits") for artists not as common (James Taylor), such that the searched album was typically 7 or 8 pages deep in the results. Thus, if searching the first page of results was unsuccessful, my modded script conducted another search of several more pages by appending /all/10 or another multiple of 10 to the original search string. I enclosed the core search code lines within a very simple loop:

...but this no longer works because of Rovi's scroll-triggered addition of search results without reloading the page. Certainly not a big deal and definitely not worth anything beyond a minimal effort, but if there is a similarly clever and almost painless way to expose additional search results, I'd like to do it. I googled "screen scraping" and jQuery, but nothing popped out at me that I could recognize as appropriate. Any tips, references or better googling keywords appreciated!

Romor, thanks for the tip. That code line returned a web page of search results that is the same as the results returned by the URL of a normal search, and ignores the "/all/" & n portion, so every time the loop iterates, I get a search page of the same first 20 results.

So unless there is a another mod to the search string to ask for more results, it seems the only way to get more results is to virtually trigger the scroll down function in some way. Upon a more careful look at the source page for a search I conduct via the browser, when a user manually scrolls down the source page does indeed update to contain the additional search results.

What I tried: I created a new version of Function Request (URL), which I call Function Request2 (URL), and just before

CODE

Request = HTTP.responseText

I added

CODE

HTTP.SendKeys "{PGDN}"

to try to simulate what a user would do. The script bombed with the error "Object doesn't support this property or method: 'HTTP.Sendkeys'"

My experimenting showed that SendKeys doesn't error out when I attempt this:

CODE

Set objShell=CreateObject("WScript.Shell")objShell.SendKeys "{PGUP}"

It feels like I'm close for better or worse. I can't tell if I'm sending the command incorrectly, need a different command, haven't and perhaps can't ensure that focus is maintained on the desired object, or if this just isn't possible given the nature of the object I'm trying to control.

Falstaff, I saw that you were trying to use SendKey here, so if you succeeded and have any advice for good or bad on this, it's appreciated.

Romor, thanks for the tip. That code line returned a web page of search results that is the same as the results returned by the URL of a normal search, and ignores the "/all/" & n portion, so every time the loop iterates, I get a search page of the same first 20 results.

aha! Such a simple check that I didn't do - I just relied on what was echoing in my cmd window - thanks! It tells me that I've got a problem in my secondary search loop, and in addition to that all I was doing was echoing the results of the first search when I thought I was seeing search results of the secondary search.

I can figure it out from here, or if I can't, I don't deserve to further inflict my inability on anyone else to get it done. Thanks again!

Apologies to users of allmusic script, but I made another update which may be of interest

While trying to improve performance, as I was feeling that something must be wrong when it takes 4-5 seconds to retrieve the data while similar scheme in other scripting language is executed in less then second, I falsely suspected Htmlfile object and tried to remove it with regex.Luckily I did the timings, and problem was pointing to Request function and it turned out that using "Msxml2.ServerXMLHTTP" was offender, which I corrected, and now script is back on track - result in second or two

Thanks for your scripts.I have a very "noob-ish" question but is it possible to execute your script if foo_allmusic.vbs is in "C:\Users\...\AppData\Roaming\foobar2000\" folder instead of in "C:\Program Files (x86)\foobar2000" ?

Sadly, I have had some trouble with marc2003's allmusic script suite (WSH Panel Mod) recently and decided to give your solution a try.And ... this is indeed convincing stuff! romor, you've got a new member in your fan club!And thanks to godrick for having asked the right questions over time, especially about accented letters. Without your inspiring dialogs with romor I would probably have been lost . Initially I made a local copy of those AMG biographies and reviews that matches the rhythmic part of my Media Library:Cache = 1 was left untouched in the latest installment of foo_allmusic.vbs.A simple foobar2000 filter - %tracknumber% IS 01 AND %discnumber% IS 1 - produced a playlist with 4,300 items.The Preview component was activated (Preview Length = 15 seconds, a lesser value is probably okay, but better safe than sorry).Some 18-19 hours (!) later the harvesting was done, yielding a single 20 MB XML file. And all was pure joy!Except of course all those times where I disagree with AMG's (inconsistent) naming of artists and albums resulting in nothing ...E.g.: I have 27 Magma albums (the French zeuhl outfit). AMG has 11 reviews. Only a few landed in my basket.In the case of the 'Ẁurdah Ītah' album (AMG gives it two names: 'Wurdah Ītah/Tristan et Iseult' resp. 'Wurdah Ītah') I may have found a primitive solution. If the solution is feasible, I'll send another post. It might be of some use in other situations.

I have a few questions. If they are stupid just ignore them, I'm a foobar2000, vbs, and xml newbie - and expect to be the laughing stock from time to time.

1. Why is it necessary to use UTF-16 in the Server settings (UTF-8 isn't good, and ANSI is worse), when your script generates UTF-8?

The //U option only tells cscript to "Use Unicode for redirected I/O from the console" as far as I can tell, not the encoding type.Or is the answer to my question blowin' in the cyberspace?

2. I suppose my little lump of gold - the 20 MB all_music.xml file - is more or less static?The cache never expires. If AMG makes a change in an artist bio (or, more unlikely, in a review) it won't be downloaded. New artists and/or albums in my collection will of course get an entry in the file, when AMG has produced some text.romor, is it beyond the scope of your very compact and streamlined script to make some sort of date check and make an AMG lookup accordingly? I imagine something like this:

If I load an artist in fb2k with an excisting AMG bio in the xml file, the script performs a check: if DateId is expired then make a request to AMG. Or is this either gibberish or impossible? The evident alternative for me is of course to perform a harvest like the above say every 90 days, that's not a problem at all.

3. If I interpret the script correctly the whole xml file is loaded into memory - and stays there - at the first request?

CODE

oXml.loadXML "<?xml version='1.0' encoding='UTF-8'?><Items></Items>"

I have not encountered any performance issues, that's very, very nice! Even on and old Vista PC with 3Ŋ cylinders. In the actual implementation there is some inevitable redundancy. I have over 50 albums with Frank Zappa. All the reviews has the biography appended to them in the file; I suppose this is a contributing factor to the short load times in the Bio View panel or is it without relevance?