I have a prob (i'm learning from already-written scripts)
Script works if a tree is shown for selection (i choose the right album and it imports all infos),.
As lots of websites, cddb directly goes to the final page if there is a unique choice (example: CURE - DISINTEGRATION shows 4 CDs and my script works, DIRE STRAITS - PLATINIUM website directly goes to this album's infos).
With this solution, it's clear that i have not written "maybe you're in the right page, analyze data without lookin' for other links).
now i show you my AnalyzeSearchPage script, and i hope u can teach me how to write it.
Ah... maybe should be important to know that search pages links are always www.gracenote.com/music/... the final pages are www.gracenote.com/xm/... so a URLBASE+ music means a picktree page, URLBASE+ xm is a database page.
my actual code (thx PIVELLO for original structure that i'm rebuiding) is:
Code: Select all
procedure AnalyzeSearchPage(Url: string);
var
FilmId: string;
begin
PageStr := RemoveExtraChars(Url);
if pos('We were unable', PageStr) > 0 then
ShowMessage('Title not found / Nessun film trovato.')
else if pos('Si è verificato un errore',PageStr) > 0 then
ShowMessage('Server not available, try later / Server non disponibile, prova più tardi')
else
begin
if MovieUrl = UrlBase + '/music' then
MovieUrl := PopulatePickTree(true)
else
begin
PopulatePickTree(false);
if not PickTreeExec(MovieUrl) then
exit;
end
AnalyzeMoviePage;
end;
end;
thx
ABN