WWW.ADICTOSALCINE.COM
Posted: 2005-05-26 13:01:21
IS A VERY GOOD PAGES , WHO CAN MAKE AN SCRIPT??
THANK YOU
THANK YOU
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=folgui (folgui@bigfoot.com)
Title=adictosalcine (ES)
Description=Movie importation script for adictosalcine
Site=http://www.adictosalcine.com
Language=ES
Version=0.1
Requires=3.5.0
Comments=Alpha version, made on the fly.
License=The source code of the script can be used in another program only if full credits to script author and a link to Ant Movie Catalog website are given in the About box or in the documentation of the program.|
GetInfo=1
[Options]
***************************************************)
program adictosalcine;
uses
StringUtils1;
const
SearchInitialURL = 'http://www.adictosalcine.com/buscar.phtml?letra=&year=&texto=';
SearchFinalURL = '&tip=0&lan0&cat=&orden=4';
BaseURL = 'http://www.adictosalcine.com/';
var
MovieName: string;
MovieURL: string;
//------------------------------------------------------------------------------------
procedure AnalyzePage(Address: string);
var
Page: TStringList;
LineNr: Integer;
Line: string;
MovieTitle, MovieAddress: string;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
if Pos('Resultados de la búsqueda', Page.Text) = 0 then
begin
ShowMessage('No se ha podido establecer la conexion.');
end else
begin
LineNr := FindLine('<strong>Título de la Película </strong>', Page, 0);
LineNr := LineNr + 7;
Line := Page.GetString(LineNr);
if Pos ('No se han encontrado coincidencias', Line) <> 0 then
begin
ShowMessage('No se han encontrado resultados para "' + MovieName + '"');
end else
begin
PickTreeClear;
Line := TextBetween (Line, 'Se muestran un máximo de <strong>', '</strong> Resultados');
PickTreeAdd('Encontrados ' + Line + ' resultados para "' + MovieName + '"', '');
Line := Page.GetString(LineNr);
repeat
MovieTitle := TextBetween (Line, 'class="menu" target="_top">', '</a></td>');
HTMLDecode(MovieTitle);
MovieAddress := TextBetween (Line, '<a href="', '" class="menu" ');
PickTreeAdd(MovieTitle, BaseURL + MovieAddress);
LineNr := LineNr + 7;
Line := Page.GetString(LineNr);
until Pos('<table', Line) > 0;
if PickTreeExec(Address) then
AnalyzeMoviePage(Address);
end;
end;
Page.Free;
end;
procedure AnalyzeMoviePage(Address: string);
var
Page: TStringList;
LineNr, aux: Integer;
Line: string;
Item: string;
Comments: string;
Actors: string;
Producers: string;
Directors: string;
Description: string;
begin
Comments := '';
Actors := '';
Producers := '';
Description := '';
Page := TStringList.Create;
Page.Text := GetPage(Address);
//Genero
LineNr := FindLine('<strong>Género:</strong>', Page, 0);
Line := Page.GetString(LineNr);
Item := TextBetween (Line, '<strong>Género:</strong>','<table width=');
HTMLDecode(Item);
SetField(fieldCategory, Trim(Item));
//Valoracion
LineNr := FindLine('<strong> Media:</strong>', Page, 0);
Line := Page.GetString(LineNr+1);
HTMLRemoveTags(Line);
Item := IntToStr(Round(StrToInt(StrGet(Line, 1), 0)));
SetField(fieldRating, Item);
//URL
LineNr := FindLine('<b>Dirección:</b> ', Page, 0);
Line := Page.GetString(LineNr);
Item := TextBetween (Line, '</b> ','<br>');
HTMLDecode(Item);
SetField(fieldURL, Trim(Item));
//Titulo
LineNr := FindLine('<td width="100%" align="center" valign="top" bgcolor="#617D99"><font size="4" color="#FFFFFF">', Page, 0);
Line := Page.GetString(LineNr);
Item := TextBetween (Line, '<strong>', '</strong></font>');
HTMLDecode(Item);
SetField(fieldTranslatedTitle, Trim(Item));
//Sinopsis
LineNr := FindLine('<strong>Sinopsis', Page, 0);
Line := Page.GetString(LineNr+1);
Item := TextBetween (Line, '<font style="font-size: 12px;">', '</font></p>');
HTMLDecode(Item);
SetField(fieldDescription, Trim(Item));
//Titulo Original
LineNr := FindLine('<strong>TÍTULO ORIGINAL</strong></td>', Page, 0);
Line := Page.GetString(LineNr+1);
Item := TextBetween (Line, '<td width="100%" bgcolor="#EEEEEE">', '</td>');
HTMLDecode(Item);
SetField(fieldOriginalTitle, Trim(Item));
//Country
LineNr := FindLine('<td><strong>NACIONALIDAD</strong></td>', Page, 0);
Line := Page.GetString(LineNr+2);
Item := TextBetween (Line, '<a href="buscar.phtml?lan=8" class="azul">','</a><a href="buscar.phtml?lan=" class="azul"></a>');
HTMLDecode(Item);
SetField(fieldCountry, Trim(Item));
//Director
LineNr := FindLine('<td><strong>DIRECTOR</strong></td>', Page, 0);
Line := Page.GetString(LineNr+3);
Item := TextBetween (Line, '<a href="buscar.phtml?texto=','&tip=0"');
HTMLDecode(Item);
SetField(fieldDirector, Trim(Item));
//Actores
LineNr := FindLine('<td><strong>LISTA DE INTÉRPRETES</strong></td>', Page, 0);
begin
LineNr := LineNr + 3;
Line := Page.GetString(LineNr);
Actors := Actors + TextBetween (Line, '<a href="buscar.phtml?texto=', '&tip=0"') + ', ';
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
while Pos ('</td></tr>', Line) = 0 do
begin
Actors := Actors + TextBetween (Line, '<a href="buscar.phtml?texto=', '&tip=0"') + ', ';
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
end;
SetField(fieldActors, Copy(Actors, 1, Length(Actors)-2));
end;
//Año
LineNr := FindLine('<td><strong>AÑO</strong></td>', Page, 0);
Line := Page.GetString(LineNr+1);
Item := TextBetween (Line, '<a href="buscar.phtml?year=','&orden=4"');
HTMLDecode(Item);
SetField(fieldYear, Trim(Item));
//Duracion
LineNr := FindLine('<td><strong>DURACIÓN</strong></td>', Page, 0);
Line := Page.GetString(LineNr+1);
Item := TextBetween (Line, '<td bgcolor="#EEEEEE">',' minutos</td>');
HTMLDecode(Item);
SetField(fieldLength, Trim(Item));
// Productor
LineNr := FindLine('<td><strong>PRODUCTOR</strong></td>', Page, 0);
begin
LineNr := LineNr + 3;
Line := Page.GetString(LineNr);
Producers := Producers + TextBetween (Line, '<a href="buscar.phtml?texto=', '&tip=0"') + ', ';
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
while Pos ('</td></tr>', Line) = 0 do
begin
Producers := Producers + TextBetween (Line, '<a href="buscar.phtml?texto=', '&tip=0"') + ', ';
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
end;
SetField(fieldProducer, Copy(Producers, 1, Length(Producers)-2));
//Comments := Comments + 'Productor(es): ' + Copy(Producers, 1, Length(Producers)-2) + #13#10;
end;
//Guionista
LineNr := FindLine('<td><strong>GUIONISTA</strong></td>', Page, 0);
Line := Page.GetString(LineNr+3);
Item := TextBetween (Line, '<a href="buscar.phtml?texto=','&tip=0"');
HTMLDecode(Item);
Comments := Comments + 'Guionista: ' + Item + #13#10;
//Musica
LineNr := FindLine('<td><strong>MÚSICA</strong></td>', Page, 0);
Line := Page.GetString(LineNr+3);
Item := TextBetween (Line, '<a href="buscar.phtml?texto=','&tip=0"');
HTMLDecode(Item);
Comments := Comments + 'Música: ' + Item + #13#10;
//Fotografia
LineNr := FindLine('<td><strong>FOTOGRAFIA</strong></td>', Page, 0);
Line := Page.GetString(LineNr+3);
Item := TextBetween (Line, '<a href="buscar.phtml?texto=','&tip=0"');
HTMLDecode(Item);
Comments := Comments + 'Fotografía: ' + Item + #13#10;
//Montaje
LineNr := FindLine('<td><strong>MONTAJE</strong></td>', Page, 0);
Line := Page.GetString(LineNr+3);
Item := TextBetween (Line, '<a href="buscar.phtml?texto=','&tip=0"');
HTMLDecode(Item);
Comments := Comments + 'Montaje: ' + Item + #13#10;
HTMLDecode(Comments);
SetField(fieldComments, Comments);
end;
begin
if CheckVersion(3,5,0) then
begin
MovieName := GetField(fieldTranslatedTitle);
if MovieName = '' then
MovieName := GetField(fieldOriginalTitle);
if Input('Importar de Adictos al Cine', 'Introduzca el titulo de la pelicula:', MovieName) then
begin
AnalyzePage(SearchInitialURL + UrlEncode(MovieName) + SearchFinalURL);
end;
end
else
ShowMessage('Este script requiere una version mas reciente de Ant Movie Catalog (por lo menos la version 3.5.0)');
end.