Script for covers Allcdcovers movies
-
- Posts: 21
- Joined: 2010-01-21 00:54:05
Script for covers Allcdcovers movies
__________
Last edited by cluis_henrique on 2014-10-02 00:56:39, edited 1 time in total.
-
- Posts: 21
- Joined: 2010-01-21 00:54:05
correction
___________
Last edited by cluis_henrique on 2014-10-02 00:56:59, edited 1 time in total.
-
- Posts: 21
- Joined: 2010-01-21 00:54:05
correction
program allcdcoversLHC;
var MovieName:string;
uses StringUtils1;
procedure AnalyzeFilmPage(Address:string);
var Page:TStringList;
PRE, INI,FIM,valor, Pag, Pag2, Text, valor2, w:String;
j, i, min, Code, min2:integer;
wl:boolean;
begin
PRE:='http://www.allcdcovers.com' ;
INI:='/download/';
FIM:='">';
Page := TStringList.Create;
Pag := GetPage(Address);
valor:=TextBetween(pag,INI,FIM);
valor2:=PRE+INI+valor;
If length(valor) > 0 then begin
i := AddExtra;
GetExtraPicture(i,valor2);
End;
Page.free;
end;
procedure AnalyzePage(Address: string);
var
Page: TStringList;
i,nLine,LineNr,EndPos: Integer;
Pag,Line,Search,Endsearch,INI,FIM: string;
url, nome_filme: string;
begin
PickTreeClear;
Page := TStringList.Create;
Search:='search/movies/all/';
Page.Text := GetPage(Address+Search+MovieName);
if (pos('Did you mean', Page.Text) = 0) then
begin
LineNr := 0;
nLine:=0;
pag := page.text;
INI := 'toggleVersionListCovers';
FIM := '">Films</a></td>';
repeat
i := pos(INI,Pag); //alterado
if (i > 0) then begin
nline:=nline+1;
Line := TextBetween(pag,INI,FIM);
nome_filme := TextBetween(Line,'false;">',' </');
url := Address+TextBetween(pag, '<td><a href="/' , '">Front</');
EndPos := length(line) ;
nome_filme := IntToStr(nLine) + ' - ' + nome_filme;
If (pos('>CD</a>',url) = 0) AND (pos('>Inside<',url) = 0) AND (pos('>Back<',url) = 0) Then
Begin
PickTreeAdd(nome_filme, url);
End;
delete(Pag,i,endpos)
end;
until (i < 1);
if PickTreeExec(Address) then begin
AnalyzeFilmPage(Address);
end;
end
else
ShowMessage('Nada achado!')
Page.Free;
end;
begin
PickListClear;
MovieName := GetField(fieldOriginalTitle);
if Input('Importar Capa do allcdcovers.com', 'Escreva o nome do filme:', MovieName) then
begin
MovieName := StringReplace(MovieName, ' ', '+');
AnalyzePage('http://www.allcdcovers.com/');
end;
end.
var MovieName:string;
uses StringUtils1;
procedure AnalyzeFilmPage(Address:string);
var Page:TStringList;
PRE, INI,FIM,valor, Pag, Pag2, Text, valor2, w:String;
j, i, min, Code, min2:integer;
wl:boolean;
begin
PRE:='http://www.allcdcovers.com' ;
INI:='/download/';
FIM:='">';
Page := TStringList.Create;
Pag := GetPage(Address);
valor:=TextBetween(pag,INI,FIM);
valor2:=PRE+INI+valor;
If length(valor) > 0 then begin
i := AddExtra;
GetExtraPicture(i,valor2);
End;
Page.free;
end;
procedure AnalyzePage(Address: string);
var
Page: TStringList;
i,nLine,LineNr,EndPos: Integer;
Pag,Line,Search,Endsearch,INI,FIM: string;
url, nome_filme: string;
begin
PickTreeClear;
Page := TStringList.Create;
Search:='search/movies/all/';
Page.Text := GetPage(Address+Search+MovieName);
if (pos('Did you mean', Page.Text) = 0) then
begin
LineNr := 0;
nLine:=0;
pag := page.text;
INI := 'toggleVersionListCovers';
FIM := '">Films</a></td>';
repeat
i := pos(INI,Pag); //alterado
if (i > 0) then begin
nline:=nline+1;
Line := TextBetween(pag,INI,FIM);
nome_filme := TextBetween(Line,'false;">',' </');
url := Address+TextBetween(pag, '<td><a href="/' , '">Front</');
EndPos := length(line) ;
nome_filme := IntToStr(nLine) + ' - ' + nome_filme;
If (pos('>CD</a>',url) = 0) AND (pos('>Inside<',url) = 0) AND (pos('>Back<',url) = 0) Then
Begin
PickTreeAdd(nome_filme, url);
End;
delete(Pag,i,endpos)
end;
until (i < 1);
if PickTreeExec(Address) then begin
AnalyzeFilmPage(Address);
end;
end
else
ShowMessage('Nada achado!')
Page.Free;
end;
begin
PickListClear;
MovieName := GetField(fieldOriginalTitle);
if Input('Importar Capa do allcdcovers.com', 'Escreva o nome do filme:', MovieName) then
begin
MovieName := StringReplace(MovieName, ' ', '+');
AnalyzePage('http://www.allcdcovers.com/');
end;
end.
Thanks
Is it three times the same by mistake? Or is there a reason for the three posts?
Also, when posting a script it is better to open the file in notepad, so you also have the header/properties/options, which are hidden in AMC's editor. But maybe here it is not a big problem if you didn't define options.
Is it three times the same by mistake? Or is there a reason for the three posts?
Also, when posting a script it is better to open the file in notepad, so you also have the header/properties/options, which are hidden in AMC's editor. But maybe here it is not a big problem if you didn't define options.
-
- Posts: 21
- Joined: 2010-01-21 00:54:05
Re: Script for covers Allcdcovers movies
I could not delete.