Recherche script pour cinestore fr

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Fleufleu2

Recherche script pour cinestore fr

Post by Fleufleu2 »

Salut,
Je recherche un script pour récupérer les infos depuis
Cinestore rubrique DVD
http://www.cinestore.com/html/home.php?groupe=1

j'ai essayé, mais sans résultat

merci d'avance, si quelqu'un a déja fait ce script

a+
fleufleu2@hotmail.com
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Je pense que si quelqu'un avait fait le script il me l'aurait envoyé ;)
Enfin j'espère :p
nono.1
Posts: 4
Joined: 2002-07-28 17:17:59

Post by nono.1 »

Suite à ton post Fleufleu2, j'ai fait un script qui devrait correspondre à ta demande. J'ai fait quelques essais ;) , mais faut quand même tester + longuement ! :/

Je l'ai aussi envoyé à l'admin.

Désolé pour la mise en page, mais les tabulations n'ont pas supportées le copier-coller :??:

// GETINFO SCRIPTING
// Cinéstore (Fr) import avec Affiche

(***************************************************
* Movie importation script for: *
* Cinéstore , http://www.cinestore .com *
* *
* (c) 2002 nono.1 *
* *
* For use with Ant Movie Catalog 3.3.1 *
* www.ant.be.tf/moviecatalog ··· www.buypin.com *
***************************************************)

program MoviesCovers;
var
MovieName: string;

function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
var
i: Integer;
begin
result := -1;
if StartAt < 0 then
StartAt := 0;
for i := StartAt to List.Count-1 do
if Pos(Pattern, List.GetString(i)) <> 0 then
begin
result := i;
Break;
end;
end;

procedure AnalyzePage(Address: string);
var
Page: TStringList;
LineNr: Integer;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
if pos('www.cinestore.com/images/fleche_jaune_1.gif" align="absmiddle"> Il y a ', Page.Text) = 0 then
AnalyzeMoviePage(Page)
else
begin
PickTreeClear;
LineNr := 0;
LineNr := FindLine('href="fiche_produits.php?groupe=1&page=1&id=', Page, LineNr);
if LineNr > -1 then
begin
PickTreeAdd('Films présents', '');
AddMoviesTitles(Page, LineNr);
end;
if PickTreeExec(Address) then
AnalyzePage(Address);
end;
Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value,FullValue : string;
LineNr, IntValue: Integer;
BeginPos, EndPos: Integer;
begin
// Picture
LineNr := FindLine('<img class="aimg" src="http://a333.g.akamai.net/f/333/6918/3h/ ... hoto/puce/', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('src="', Line)+5;
EndPos := pos('" width="70" height="100" border="1">', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
GetPicture(Value, False);
end
// Translated Title
LineNr := FindLine('<font color="#FFE78B" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('<b>', Line);
EndPos := pos('</b>', Line);
Value := copy(Line, BeginPos + 3, EndPos - BeginPos - 3);
HTMLRemoveTags(Value);
HTMLDecode(Value);
SetField(fieldTranslatedTitle, Value);
end;
// Description
LineNr := FindLine('histoire :</b>', Page, LineNr);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr+3);
Value := StringReplace(Line,' ','');
HTMLRemoveTags(Value);
HTMLDecode(Value);
SetField(fieldDescription, Value);
end;
// Category
LineNr := FindLine('src="http://a333.g.akamai.net/f/333/6918/3h/ ... heme_1.gif"', Page, 0);
if LineNr > -1 then
begin
repeat
LineNr := LineNr+1;
Line := Page.GetString(LineNr);
until pos('</tr>', Line) > 0;
Line := Page.GetString(LineNr+2);
BeginPos := pos('color="#000000">', Line)+16;
EndPos := pos('</font></td>', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
HTMLRemoveTags(Value);
HTMLDecode(Value);
SetField(fieldCategory, Value);
end;
// Length
LineNr := FindLine('<font color="#FFE78B" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr+2);
Delete(Line, 1,pos('/', Line));
Delete(Line, 1,pos('/', Line));
Delete(Line, 1,pos('/', Line));
EndPos := pos('mn', Line);
Value := copy(Line, 1, EndPos - 2);
HTMLRemoveTags(Value);
HTMLDecode(Value);
SetField(fieldLength, Value);
end;
// Actors
LineNr := FindLine('color="#FFE78B"><b>Acteur(s) :</b>', Page, 0);
if LineNr > -1 then
begin
FullValue := '';
Line := Page.GetString(LineNr);
repeat
BeginPos := pos('width=400,height=500', Line);
Delete(Line, 1, BeginPos+23);
EndPos := pos('</a>', Line);
Value := copy(Line, 1, EndPos - 1);
if FullValue <> '' then
FullValue := FullValue + ', ';
FullValue := FullValue + Value;
until pos('width=400,height=500',Line) = 0;
HTMLRemoveTags(FullValue);
HTMLDecode(FullValue);
SetField(fieldActors, FullValue);
end;
// Director
LineNr := FindLine('alisateur(s) :</b></font>', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos:= pos('scrollbars=yes,top=0,left=0,width=400,height=500',Line);
EndPos := pos('</a></font>', Line);
Value := copy(Line, BeginPos+52, EndPos - BeginPos-52);
HTMLRemoveTags(Value);
HTMLDecode(Value);
SetField(fieldDirector, Value);
end;
DisplayResults;
end;

procedure AddMoviesTitles(Page: TStringList; var LineNr: Integer);
var
MovieProduct,MovieTitle, MovieAddress, Line, LineProduct: string;
StartPos, LineNRProduct: Integer;
begin
LineNr := LineNr - 1;
repeat
LineNr := LineNr + 1;
LineNRProduct := LineNr;
Line := Page.GetString(LineNr);
StartPos := pos('size="1"><b><a href="fiche_produits.php?groupe=1&page=1&id=', Line);
if StartPos > 0 then
begin
Delete(Line, 1, StartPos);
StartPos := pos('"><font color="FFE78B">', Line);
MovieAddress := copy(Line, 59, StartPos-59);
MovieTitle := copy(Line, StartPos+23, pos('</font></a></b><font color="#FFFFFF"', Line)-StartPos-23);
HTMLRemoveTags(MovieTitle);
HTMLDecode(MovieTitle);
repeat
LineNRProduct := LineNRProduct+1;
LineProduct := Page.GetString(LineNRProduct);
until pos('>de </font>', LineProduct) > 0;
StartPos := pos('left=0,width=400,height=500',LineProduct);
Delete(LineProduct,1,StartPos+30);
MovieProduct :=copy(LineProduct, 1,pos('</a></font>',LineProduct)-1);
HTMLRemoveTags(MovieProduct);
HTMLDecode(MovieProduct);
MovieProduct := ' (de ' + MovieProduct + ')';
PickTreeAdd(MovieTitle+MovieProduct, 'http://www.cinestore.com/html/fiche_pro ... 83c5f53f05');
end;
until pos('</TABLE>', Line) > 0;
end;

begin
if CheckVersion(3,3,1) then
begin
MovieName := GetField(fieldTranslatedTitle);
if MovieName = '' then
MovieName := GetField(fieldOriginalTitle);
if Input('Importation de Cinéstore.com', 'Entrer le titre du film:', MovieName) then
begin
AnalyzePage('http://www.cinestore.com/html/liste_sim ... 1&x=10&y=5');
end;
end else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.3.1)');
end.
nono.1
Posts: 4
Joined: 2002-07-28 17:17:59

Post by nono.1 »

J'ai modifié le script Cinestore suite au changement du contenu des pages de www.cinestore.com.
Je l'ai mis dans la BAL de l'admin.

A+
:)
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Les fichiers sont en cours d'upload sur le serveur ;)
ça sera prêt d'ici quelques minutes
Post Reply