Page 1 of 1

[REL][ITA] LaFeltrinelli.it / GiLib.pas

Posted: 2010-08-28 07:00:53
by lucamark
Hi guys, here is the script to get movie info from http://www.lafeltrinelli.it.
Is possible (as usual) to search for a title and also for barcode..
@sCeRiFz: Please Test this version (changed from the first I sent you..)


Ciao,in allegato lo script per il sito http://www.lafeltrinelli.it.
E' possibile (come al solito) ricercare per titolo, ma anche per codice a barre..
@sCeRiFz: Testa questa versione (diversa da quella che ti ho mandato..)

Test & Feedback are welcome..
Ciao!

LaFeltrinelli.it.ifs

Code: Select all

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/

[Infos]
Authors=Gigibop (luca.marcato@gmail.com)
Title=LaFeltrinelli
Description=Get movie info from http://www.lafeltrinelli.it
Site=http://www.lafeltrinelli.it
Language=IT
Version=1.0 - 27.08.2010
Requires=3.5.0
Comments=Changes|27.08.2010 v. 1.0: First revision (Gigibop)
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 LaFeltrinelli;
uses
  GiLib,StringUtils1;

var
  MovieName: string;
  TheMovieAddress: string;
const
  UrlBase = 'http://www.lafeltrinelli.it';
  
procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine('<div class="informazioniProdotto">', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then AnalyzePage(Address);
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line: String;
  LineNr: Integer;
begin
  
  // Translated Title
  LineNr := FindLine('<div id="schedaProdotto">', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<div id="schedaProdotto">', '</a>'),True,True);
      SetField(fieldTranslatedTitle, Line);
    end;

  // Original Title
  LineNr := FindLine('<dt>Titolo in lingua originale</dt>', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Titolo in lingua originale</dt>', '</dd>'),True,True);
      SetField(fieldOriginalTitle, Line);
    end;

  // Director
  LineNr := FindLine('<h4 id="regista">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</em>', '</h4>'),True,True);
      SetField(fieldDirector,Line);
    end;

  // Cast
  LineNr := FindLine('<h4 id="attori">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<h4 id="attori"><em>Con: </em>', '</h4>'),True,True);
      SetField(fieldActors,Line);
    end;

  //  Production
  LineNr := FindLine('<dt>Produzione</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Produzione</dt>', '</dd>'),True,True);
    SetField(fieldProducer,Line);
  end;

  //  Genre
  LineNr := FindLine('<dt>Genere</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Genere</dt>','</dd></dl>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Genere</dt><dd>', '</dd>'),True,True);
    SetField(fieldCategory,Line);
  end;

  // Year
  LineNr := FindLine('<dt>Data uscita</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextAfter(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Data uscita</dt>', '</dd>'),True,True),'/');
    SetField(fieldYear,Line);
  end;

  // Lenght
  LineNr := FindLine('<dt>Durata</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Durata</dt>', '</dd>'),True,True);
    SetField(fieldLength,Line);
  end;

  // Disks Number
  LineNr := FindLine('<dt>N. DVD</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>N. DVD</dt>', '</dd>'),True,True);
    SetField(fieldDisks,Line);
  end;

  // Description
  LineNr := FindLine('<p class="abstract">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= UTF8Decode(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<p class="abstract">', '</p>'),True,True));
    SetField(fieldDescription,Line);
  end;

  // Picture
  LineNr := FindLine('<p class="copertina copertinal">', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<p class="copertina copertinal">','</p>' , LineNr);
    Line := TextBetween(Line,'src="','"/>');
    Line := GHtmlDecodeAndClean(Line,false,false);

    GetPicture(UrlBase + Line);
  end;

  //  Audio Tracks
  LineNr := FindLine('<dt>Lingue</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Lingue</dt>','<dt>Sottotitoli</dt>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Lingue</dt>', '</dd>'),True,True);
    SetField(fieldLanguages, Line);
  end

  // SubTitles
  LineNr := FindLine('<dt>Sottotitoli</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Sottotitoli</dt>','<dt>Genere</dt>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Sottotitoli</dt>', '</dd>'),True,True);
    SetField(fieldSubtitles, Line);
  end;

  // MediaLabel --> Barcode
  LineNr := FindLine('<dt>EAN</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>EAN</dt>', '</dd>'),True,True);
    SetField(fieldMedia, Line);
  end;

  // Media Type
  LineNr := FindLine('<dt>Supporto</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Supporto</dt>', '</dd>'),True,True);
    Line := TextBefore(Line, ' FILM', '');
    SetField(fieldMediaType, Line);
  end;

  // Country
  LineNr := FindLine('<dt>Paese</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Paese</dt>', '</dd>'),True,True);
    SetField(fieldCountry, Line);
  end;

end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;

  Line: string;
  i: Integer;
  MovieTitle, MovieAddress, Description: string;
  BeginPos, EndPos: Integer;  
  begin
  LineNr := 0;
  LineNr := FindLine('<div class="informazioniProdotto">',Page,LineNr);
	while LineNr > -1 do
	  begin

	    Line:= GJoinMultipleLines(Page, '<div class="informazioniProdotto">','</h4>' , LineNr);

	    MovieAddress:= GHtmlDecodeAndClean(TextBetween(Line, 'a href="', '"'),True,True);

	    MovieTitle:= GHtmlDecodeAndClean(TextBefore(Line, '</a>', ''),True,True);

	    Description := TextBetween(Line, '<p class="supporto">', '</p>');

	    if Description = '' then Description := TextBefore(Line, 'Non disponibile', '</A>');
	    if MovieTitle > '' then PickTreeAdd(MovieTitle + ' (' + Description + ')', MovieAddress);

	    if TheMovieAddress='*' then
	      TheMovieAddress := MovieAddress
	    else
	      TheMovieAddress := '';

	    LineNr := FindLine('<div class="informazioniProdotto">',Page,LineNr+1);

	  end;
 
  LineNr := FindLine('<p style="height: auto;" class="pagine">',Page,LineNr);
  Line := Page.GetString(LineNr);

  Line := TextBetween(Line, '<p style="height: auto;" class="pagine">', '</p>');

  BeginPos := pos('href',Line);
  if BeginPos>0 then
  begin
    Delete(Line,1,BeginPos + 5);
    EndPos := pos('"',Line);
    MovieAddress := copy(Line,1,EndPos-1);

    PickTreeMoreLink('http://www.lafeltrinelli.it' + GHtmlDecode(MovieAddress,true));
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

// -----------------------------
// Questo è il main dello script
// -----------------------------
begin
  if CheckVersion(3,5,0) then
   begin
   
	NewGiLib;
    TheMovieAddress := '*';
    MovieName := StringReplace(GetField(fieldTranslatedTitle), '.', ' ');
    if MovieName = '' then
      MovieName := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
	While pos ('[', MovieName) > 0 Do begin
	MovieName := TextBefore(MovieName, '[', '') + TextAfter(MovieName, ']');
	end;
    if Input('LaFeltrinelli Importazione Film', 'Digitare il titolo del film / Codice a Barre:', MovieName) then
    begin		
      AnalyzePage(UrlBase + '/fcom/it/home/pages/catalogo/searchresults.html?prkw='+UrlEncode(MovieName)+'&srch=0&Cerca.x=0&Cerca.y=0&cat1=5&prm=');
    end;
	FinalizeGiLib;
   end
  else
    ShowMessage('Questo script richiede una versione più nuova di Ant Movie Catalog (almeno la versione 3.5.0)');
end.

GiLib.pas

Code: Select all

(*=============================================================
	Gigibop's Library
	Authors=Gigibop (luca.marcato@gmail.com)
	Description= Useful Procedures and Functions
	Version=1.0
 	
	ChangeLog:
	27.08.2010 v. 1.0: First revision (Gigibop)

	Joyride... Si o no??? Ma anche no!!!
=============================================================*)

Unit GiLib;
uses
	StringUtils1;
Var
  TPage: TStringList;
  
//===================================================
// Constructor/Finalize lib
//===================================================
Procedure NewGiLib;
Begin
  TPage := TStringList.Create;  
End;

Procedure FinalizeGiLib;
Begin
  TPage.Free;
End;

//===================================================
// Remove Tabs from a string
//===================================================
Function GRemoveTabs(sVal : String) : String;
Begin
	Repeat
		sVal:= StringReplace(sVal, '   ', '');
	Until (pos('   ',sVal) = 0);
	
	result := sVal;
end;

//===================================================
// Left and Right Trim from a string
//===================================================
Function GLeftRightTrim(sVal: String): String;
Var
	bExit: Boolean;
Begin
    
	bExit := False;
  
	Repeat
		Case copy(sVal, 1, 1) Of ' ', #9, #10, #13:
			sVal := copy(sVal, 2, Length(sVal)-1);
		Else
			bExit := True;
		End;
	Until bExit;
  
	bExit := False;
  
	Repeat
		Case copy(sVal, Length(sVal), 1) Of ' ', #9, #10, #13: 
			sVal := copy(sVal, 1, Length(sVal)-1);
		Else
			bExit := True;
		End;
	Until bExit;
  
	result := sVal;
End;

//===================================================
// Html Decode and Trim
//===================================================
Function GHtmlDecode(sVal: String ; bTrim: boolean) :String;
Begin
	  
	HTMLDecode(sVal);
   
	If bTrim = True Then
		sVal := GLeftRightTrim(sVal);
   
	result := sVal;
End;

//===================================================
// Html Decode, Trim and Remove Tabs
//===================================================
Function GHtmlDecodeAndClean(sVal: String; bTabs: Boolean; bTrim: Boolean) :String;
Begin

	HTMLRemoveTags(sVal);
	HTMLDecode(sVal);
  
	If bTabs = True Then
		sVal := GRemoveTabs(sVal);
	If bTrim = True Then
		sVal := GLeftRightTrim(sVal);
		
	result := sVal;
End;

//===================================================
// Join Multiple Lines in a String
//===================================================
Function GJoinMultipleLines(sPage: TStringList; sTextFrom: String; sTextTo: String; iStartLine: Integer) :String;
Var
	IEnd,I : Integer;
	sLine: String;
Begin

	IEnd := 0;
	sLine := '';
	
	iStartLine := FindLine(sTextFrom,sPage,iStartLine);

	If iStartLine > 0 Then IEnd := FindLine(sTextTo,sPage,iStartLine);

	For I:= iStartLine To IEnd Do
	Begin
		sLine:= sLine + sPage.GetString(i);;
	End;

  result := sLine;

End;

Procedure GDebug(sVal: String; sFileName: String);
Begin
  
  TPage.Text := sVal;
  TPage.SaveToFile(sFileName);
  TPage.Free;
End;
  
End.


Posted: 2010-08-28 08:42:20
by fulvio53s03
That's all OK.
In MP a few questions.

Ottimo, provato con un po' di film e funziona bene.
in MP un paio di domande.

hihi:

Posted: 2010-08-28 12:52:43
by lucamark
@fulvio53s03 PM Sent..

Posted: 2010-09-02 10:06:09
by lucamark
Updated Script with Option (CercaTitoloEsatto) to search for exact movie title or all around site.

Script aggiornato con un'opzione (CercaTitoloEsatto) per ricercare tramite titolo esatto o in tutta l'area cinema.

Code: Select all

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/

[Infos]
Authors=Gigibop (luca.marcato@gmail.com)
Title=LaFeltrinelli
Description=Get movie info from http://www.lafeltrinelli.it
Site=http://www.lafeltrinelli.it
Language=IT
Version=1.1 - 27.08.2010
Requires=3.5.0
Comments=Changes|27.08.2010 v. 1.0: First revision (Gigibop)|02.09.2010 v. 1.1: Added an option (CercaTitoloEsatto) to search for exact movie title or all around site (Gigibop)
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]
CercaTitoloEsatto=1|1|1=Cerca il titolo esatto (Standard)|0=Cerca in tutto il settore cinema del sito
***************************************************)

program LaFeltrinelli;
uses
  GiLib;

var
  MovieName: string;
  TheMovieAddress: string;
const
  UrlBase = 'http://www.lafeltrinelli.it';
 
procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine('<div class="informazioniProdotto">', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then AnalyzePage(Address);
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line: String;
  LineNr: Integer;
begin
 
  // Translated Title
  LineNr := FindLine('<div id="schedaProdotto">', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<div id="schedaProdotto">', '</a>'),True,True);
      SetField(fieldTranslatedTitle, Line);
    end;

  // Original Title
  LineNr := FindLine('<dt>Titolo in lingua originale</dt>', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Titolo in lingua originale</dt>', '</dd>'),True,True);
      SetField(fieldOriginalTitle, Line);
    end;

  // Director
  LineNr := FindLine('<h4 id="regista">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</em>', '</h4>'),True,True);
      SetField(fieldDirector,Line);
    end;

  // Cast
  LineNr := FindLine('<h4 id="attori">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<h4 id="attori"><em>Con: </em>', '</h4>'),True,True);
      SetField(fieldActors,Line);
    end;

  //  Production
  LineNr := FindLine('<dt>Produzione</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Produzione</dt>', '</dd>'),True,True);
    SetField(fieldProducer,Line);
  end;

  //  Genre
  LineNr := FindLine('<dt>Genere</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Genere</dt>','</dd></dl>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Genere</dt><dd>', '</dd>'),True,True);
    SetField(fieldCategory,Line);
  end;

  // Year
  LineNr := FindLine('<dt>Data uscita</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextAfter(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Data uscita</dt>', '</dd>'),True,True),'/');
    SetField(fieldYear,Line);
  end;

  // Lenght
  LineNr := FindLine('<dt>Durata</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>Durata</dt>', '</dd>'),True,True);
    SetField(fieldLength,Line);
  end;

  // Disks Number
  LineNr := FindLine('<dt>N. DVD</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<dt>N. DVD</dt>', '</dd>'),True,True);
    SetField(fieldDisks,Line);
  end;

  // Description
  LineNr := FindLine('<p class="abstract">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= UTF8Decode(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<p class="abstract">', '</p>'),True,True));
    SetField(fieldDescription,Line);
  end;

  // Picture
  LineNr := FindLine('<p class="copertina copertinal">', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<p class="copertina copertinal">','</p>' , LineNr);
    Line := TextBetween(Line,'src="','"/>');
    Line := GHtmlDecodeAndClean(Line,false,false);

    GetPicture(UrlBase + Line);
  end;

  //  Audio Tracks
  LineNr := FindLine('<dt>Lingue</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Lingue</dt>','<dt>Sottotitoli</dt>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Lingue</dt>', '</dd>'),True,True);
    SetField(fieldLanguages, Line);
  end

  // SubTitles
  LineNr := FindLine('<dt>Sottotitoli</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := GJoinMultipleLines(Page, '<dt>Sottotitoli</dt>','<dt>Genere</dt>' , LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Sottotitoli</dt>', '</dd>'),True,True);
    SetField(fieldSubtitles, Line);
  end;

  // MediaLabel --> Barcode
  LineNr := FindLine('<dt>EAN</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>EAN</dt>', '</dd>'),True,True);
    SetField(fieldMedia, Line);
  end;

  // Media Type
  LineNr := FindLine('<dt>Supporto</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Supporto</dt>', '</dd>'),True,True);
    Line := TextBefore(Line, ' FILM', '');
    SetField(fieldMediaType, Line);
  end;

  // Country
  LineNr := FindLine('<dt>Paese</dt>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<dt>Paese</dt>', '</dd>'),True,True);
    SetField(fieldCountry, Line);
  end;

end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;

  Line: string;
  i: Integer;
  MovieTitle, MovieAddress, Description: string;
  BeginPos, EndPos: Integer; 
  begin
  LineNr := 0;
  LineNr := FindLine('<div class="informazioniProdotto">',Page,LineNr);
   while LineNr > -1 do
     begin

       Line:= GJoinMultipleLines(Page, '<div class="informazioniProdotto">','</h4>' , LineNr);

       MovieAddress:= GHtmlDecodeAndClean(TextBetween(Line, 'a href="', '"'),True,True);

       MovieTitle:= GHtmlDecodeAndClean(TextBefore(Line, '</a>', ''),True,True);

       Description := TextBetween(Line, '<p class="supporto">', '</p>');

       if Description = '' then Description := TextBefore(Line, 'Non disponibile', '</A>');
       if MovieTitle > '' then PickTreeAdd(MovieTitle + ' (' + Description + ')', MovieAddress);

       if TheMovieAddress='*' then
         TheMovieAddress := MovieAddress
       else
         TheMovieAddress := '';

       LineNr := FindLine('<div class="informazioniProdotto">',Page,LineNr+1);

     end;
 
  LineNr := FindLine('<p style="height: auto;" class="pagine">',Page,LineNr);
  Line := Page.GetString(LineNr);

  Line := TextBetween(Line, '<p style="height: auto;" class="pagine">', '</p>');

  BeginPos := pos('href',Line);
  if BeginPos>0 then
  begin
    Delete(Line,1,BeginPos + 5);
    EndPos := pos('"',Line);
    MovieAddress := copy(Line,1,EndPos-1);

    PickTreeMoreLink('http://www.lafeltrinelli.it' + GHtmlDecode(MovieAddress,true));
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

// -----------------------------
// Questo è il main dello script
// -----------------------------
begin
  if CheckVersion(3,5,0) then
   begin
   
   NewGiLib;
    TheMovieAddress := '*';
    MovieName := StringReplace(GetField(fieldTranslatedTitle), '.', ' ');
    if MovieName = '' then
      MovieName := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
   While pos ('[', MovieName) > 0 Do begin
   MovieName := TextBefore(MovieName, '[', '') + TextAfter(MovieName, ']');
   end;
    if Input('LaFeltrinelli Importazione Film', 'Digitare il titolo del film / Codice a Barre:', MovieName) then
    begin
		AnalyzePage(UrlBase + '/fcom/it/home/pages/catalogo/searchresults.html?prkw='+UrlEncode(MovieName)+'&srch=' + IntToStr(GetOption('CercaTitoloEsatto')) + '&Cerca.x=0&Cerca.y=0&cat1=5&prm=');
    end;
   FinalizeGiLib;
   end
  else
    ShowMessage('Questo script richiede una versione più nuova di Ant Movie Catalog (almeno la versione 3.5.0)');
end.
Bye!!

Posted: 2010-09-03 17:50:40
by antp
Thanks

Posted: 2010-09-07 19:52:08
by otreux
Thank's but I receive an error msg:

"Error script in "LAFELTRINELLI" unit is not found linea 5

Posted: 2010-09-07 20:48:08
by fulvio53s03
@otreux. devi copiare anche GiLib.pas (il codice è più sopra) nella cartella scripts.

@otreux. You must copy Gilib.pas (up from here) in Scripts' folder.

Posted: 2010-09-07 20:58:36
by otreux
ok thank's

Grazie :)

Script Updated

Posted: 2012-06-03 07:43:10
by lucamark
Dear All,
due to site changes here is the (hopefully) fixed script.
I've just tried with a couple of titles, so if you will find something please let me know.

Ciao,
ecco lo script corretto dopo gli update del sito. L'ho provato in velocità con un paio di titoli, quindi per qualsiasi errore fatemi sapere.

Code: Select all

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/

[Infos]
Authors=Gigibop (luca.marcato@gmail.com)
Title=LaFeltrinelli
Description=Get movie info from http://www.lafeltrinelli.it
Site=http://www.lafeltrinelli.it
Language=IT
Version=1.2 - 2012-06-03
Requires=3.5.0
Comments=Changes|27.08.2010 v. 1.0: First revision (Gigibop)|02.09.2010 v. 1.1: Added an option (CercaTitoloEsatto) to search for exact movie title or all around site (Gigibop)|03.06.2012 v. 1.2: Fixed complete script due to site HTML changes (Gigibop)
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]
CercaTitoloEsatto=1|1|1=Cerca il titolo esatto (Standard)|0=Cerca in tutto il settore cinema del sito

***************************************************)

program LaFeltrinelli;
uses
  GiLib;

var
  MovieName: string;
  TheMovieAddress: string;
const
  UrlBase = 'http://www.lafeltrinelli.it';
 
procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
  PageStr: string;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  PageStr:= Page.Text;
  LineNr := FindLine('<div class="product-result">', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then AnalyzePage(Address);
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line: String;
  LineNr: Integer;
  PageStr: string;
begin
 
  PageStr:= Page.Text;
  // Translated Title
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span itemprop="name">', '</span>'),True,True);
      SetField(fieldTranslatedTitle, Line);
    end;

  // Original Title
  LineNr := FindLine('<span class="name">Titolo in lingua originale</span>', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Titolo in lingua originale</span>', '</span>'),True,True);
      SetField(fieldOriginalTitle, Line);
    end;

  // Director
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</span></h1><h2>Regia di: ', '</a><br/>'),True,True);
      SetField(fieldDirector,Line);
    end;

  // Cast
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</a><br/>Con: ', '<div class="social">'),True,True);
      SetField(fieldActors,Line);
    end;

  //  Production
  LineNr := FindLine('Produzione</span><span class="value">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), 'Produzione</span><span class="value">', '</span>'),True,True);
    SetField(fieldProducer,Line);
  end;

  //  Genre
  LineNr := FindLine('<span class="name">Genere:</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Genere:</span>', '</span>'),True,True);
    SetField(fieldCategory,Line);
  end;

  // Year
  LineNr := FindLine('<span class="name">Data uscita</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextAfter(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Data uscita</span>', '</span>'),True,True),'/');
    SetField(fieldYear,Line);
  end;

  // Lenght
  LineNr := FindLine('<span class="name">Durata</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Durata</span>', '</span>'),True,True);
    SetField(fieldLength,Line);
  end;

  // Disks Number
  LineNr := FindLine('<span class="name">N. DVD</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">N. DVD</span>', '</span>'),True,True);
    SetField(fieldDisks,Line);
  end;

  // Description
  LineNr := FindLine('<div class="block"><h3>Sinossi', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= UTF8Decode(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<h3>Sinossi</h3><p>', '</p></div>'),True,True));
    SetField(fieldDescription,Line);
  end;

  // Picture
  LineNr := FindLine('</div><div class="basic-info"><div class="left col-left">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextBetween(Line,'src="//','" class="picture"');
    Line := GHtmlDecodeAndClean(Line,false,false);
    GetPicture('http://' + Line);
    //GetPicture(UrlBase + Line);
  end;

  //  Audio Tracks
  LineNr := FindLine('<span class="name">Lingue</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Lingue</span>', '</span>'),True,True);
    SetField(fieldLanguages, Line);
  end

  // SubTitles
  LineNr := FindLine('<span class="name">Sottotitoli</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Sottotitoli</span>', '</span>'),True,True);
    SetField(fieldSubtitles, Line);
  end;

  // MediaLabel --> Barcode
  LineNr := FindLine('<span class="name">EAN</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">EAN</span>', '</span>'),True,True);
    SetField(fieldMedia, Line);
  end;

  // Media Type
  LineNr := FindLine('<span class="name">Supporto</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Supporto</span>', '</span>'),True,True);
    Line := TextBefore(Line, ' film', '');
    SetField(fieldMediaType, Line);
  end;

  // Country
  LineNr := FindLine('<span class="name">Paese</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Paese</span>', '</span>'),True,True);
    SetField(fieldCountry, Line);
  end;

end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;

  Line: string;
  i: Integer;
  MovieTitle, MovieAddress, Description: string;
  BeginPos, EndPos: Integer; 
  begin
  LineNr := 0;
  LineNr := FindLine('<div class="block home video">',Page,LineNr);
   while LineNr > -1 do
     begin

       //Line:= GJoinMultipleLines(Page, '<div class="informazioniProdotto">','</h4>' , LineNr);
       Line := Page.GetString(LineNr);
       
       MovieAddress:= GHtmlDecodeAndClean(TextBetween(Line, '<div class="description"><h3><a href="', '"'),True,True);

       MovieTitle:= GHtmlDecodeAndClean(TextBetween(Line, '<div class="description">', '</a></h3><h4>'),True,True);

       Description := GHtmlDecodeAndClean(TextBetween(Line, '</a></h3><h4>', '</a></h4><h5>'),True,True);

       if Description = '' then Description := TextBetween(Line, 'Non disponibile', '</A>');
       if MovieTitle > '' then PickTreeAdd(MovieTitle + ' (' + Description + ')', MovieAddress);

       if TheMovieAddress='*' then
         TheMovieAddress := MovieAddress
       else
         TheMovieAddress := '';

       LineNr := FindLine('<div class="block home video">',Page,LineNr+1);

     end;
 
  LineNr := FindLine('<p style="height: auto;" class="pagine">',Page,LineNr);
  Line := Page.GetString(LineNr);

  Line := TextBetween(Line, '<p style="height: auto;" class="pagine">', '</p>');

  BeginPos := pos('href',Line);
  if BeginPos>0 then
  begin
    Delete(Line,1,BeginPos + 5);
    EndPos := pos('"',Line);
    MovieAddress := copy(Line,1,EndPos-1);

    PickTreeMoreLink('http://www.lafeltrinelli.it' + GHtmlDecode(MovieAddress,true));
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

// -----------------------------
// Questo è il main dello script
// -----------------------------
begin
  if CheckVersion(3,5,0) then
   begin
   
   NewGiLib;
    TheMovieAddress := '*';
    MovieName := StringReplace(GetField(fieldTranslatedTitle), '.', ' ');
    if MovieName = '' then
      MovieName := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
   While pos ('[', MovieName) > 0 Do begin
   MovieName := TextBefore(MovieName, '[', '') + TextAfter(MovieName, ']');
   end;
    if Input('LaFeltrinelli Importazione Film', 'Digitare il titolo del film / Codice a Barre:', MovieName) then
    begin
		AnalyzePage(UrlBase + '/fcom/it/home/pages/catalogo/searchresults.html?prkw='+UrlEncode(MovieName)+'&srch=' + IntToStr(GetOption('CercaTitoloEsatto')) + '&Cerca.x=0&Cerca.y=0&cat1=5&prm=');
    end;
   FinalizeGiLib;
   end
  else
    ShowMessage('Questo script richiede una versione più nuova di Ant Movie Catalog (almeno la versione 3.5.0)');
end.

Posted: 2012-06-03 20:53:15
by antp
Thanks

Posted: 2013-08-26 07:23:57
by fulvio53s03
Update!

Code: Select all

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/

[Infos]
Authors=Gigibop (luca.marcato@gmail.com)
Title=LaFeltrinelli
Description=Get movie info from http://www.lafeltrinelli.it
Site=http://www.lafeltrinelli.it
Language=IT
Version=1.2.1 - 2013-08-26
Requires=3.5.0
Comments=Changes|27.08.2010 v. 1.0: First revision (Gigibop)|02.09.2010 v. 1.1: Added an option (CercaTitoloEsatto) to search for exact movie title or all around site (Gigibop)|03.06.2012 v. 1.2: Fixed complete script due to site HTML changes (Gigibop)|26.08.2013 v. 1.2.1: Fixed:  no "sinopsi" but "description" for field-description (Fulvio53s03)
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
RequiresMovies=1

[Options]
CercaTitoloEsatto=1|1|1=Cerca il titolo esatto (Standard)|0=Cerca in tutto il settore cinema del sito

[Parameters]

***************************************************)

program LaFeltrinelli;
uses
  GiLib;

var
  MovieName: string;
  TheMovieAddress: string;
const
  UrlBase = 'http://www.lafeltrinelli.it';
 
procedure AnalyzePage(Address: string);
var
  Page: TStringList;
  LineNr: integer;
  BeginPos: integer;
  PageStr: string;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  PageStr:= Page.Text;
  LineNr := FindLine('<div class="product-result">', Page, 0);
  if LineNr = -1 then
  begin
    SetField(fieldURL, Address);
    AnalyzeMoviePage(Page);
  end
  else
  begin
    PickTreeClear;
    AddMoviesTitles(Page);
    if TheMovieAddress='' then
    begin
      if PickTreeExec(Address) then AnalyzePage(Address);
    end
    else
    begin
      SetField(fieldURL, TheMovieAddress);
      Page.Text := GetPage(TheMovieAddress);
      AnalyzeMoviePage(Page);
    end;
  end;
  Page.Free;
end;

procedure AnalyzeMoviePage(Page: TStringList);
var
  Line: String;
  LineNr: Integer;
  PageStr: string;
begin
 
  PageStr:= Page.Text;
  // Translated Title
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span itemprop="name">', '</span>'),True,True);
      SetField(fieldTranslatedTitle, Line);
    end;

  // Original Title
  LineNr := FindLine('<span class="name">Titolo in lingua originale</span>', Page, 0);
  if LineNr > -1 then
    begin
      Line:= Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Titolo in lingua originale</span>', '</span>'),True,True);
      SetField(fieldOriginalTitle, Line);
    end;

  // Director
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</span></h1><h2>Regia di: ', '</a><br/>'),True,True);
      SetField(fieldDirector,Line);
    end;

  // Cast
  LineNr := FindLine('<span itemprop="name">', Page, 0);
  if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '</a><br/>Con: ', '<div class="social">'),True,True);
      SetField(fieldActors,Line);
    end;

  //  Production
  LineNr := FindLine('Produzione</span><span class="value">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), 'Produzione</span><span class="value">', '</span>'),True,True);
    SetField(fieldProducer,Line);
  end;

  //  Genre
  LineNr := FindLine('<span class="name">Genere:</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Genere:</span>', '</span>'),True,True);
    SetField(fieldCategory,Line);
  end;

  // Year
  LineNr := FindLine('<span class="name">Data uscita</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextAfter(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Data uscita</span>', '</span>'),True,True),'/');
    SetField(fieldYear,Line);
  end;

  // Lenght
  LineNr := FindLine('<span class="name">Durata</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">Durata</span>', '</span>'),True,True);
    SetField(fieldLength,Line);
  end;

  // Disks Number
  LineNr := FindLine('<span class="name">N. DVD</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line:= GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<span class="name">N. DVD</span>', '</span>'),True,True);
    SetField(fieldDisks,Line);
  end;

  // Description
  LineNr := FindLine('<div class="block"><h3>Descrizione', Page, 0);  //fs  era <div class="block"><h3>Sinossi
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
//fs    Line:= UTF8Decode(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<h3>Sinossi</h3><p>', '</p></div>'),True,True));
    Line:= UTF8Decode(GHtmlDecodeAndClean(TextBetween(Page.GetString(LineNr), '<h3>Descrizione</h3><p>', '</p></div>'),True,True));

    SetField(fieldDescription,Line);
  end;

  // Picture
  LineNr := FindLine('</div><div class="basic-info"><div class="left col-left">', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := TextBetween(Line,'src="//','" class="picture"');
    Line := GHtmlDecodeAndClean(Line,false,false);
    GetPicture('http://' + Line);
    //GetPicture(UrlBase + Line);
  end;

  //  Audio Tracks
  LineNr := FindLine('<span class="name">Lingue</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Lingue</span>', '</span>'),True,True);
    SetField(fieldLanguages, Line);
  end

  // SubTitles
  LineNr := FindLine('<span class="name">Sottotitoli</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Sottotitoli</span>', '</span>'),True,True);
    SetField(fieldSubtitles, Line);
  end;

  // MediaLabel --> Barcode
  LineNr := FindLine('<span class="name">EAN</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">EAN</span>', '</span>'),True,True);
    SetField(fieldMedia, Line);
  end;

  // Media Type
  LineNr := FindLine('<span class="name">Supporto</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Supporto</span>', '</span>'),True,True);
    Line := TextBefore(Line, ' film', '');
    SetField(fieldMediaType, Line);
  end;

  // Country
  LineNr := FindLine('<span class="name">Paese</span>', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    Line := GHtmlDecodeAndClean(TextBetween(Line, '<span class="name">Paese</span>', '</span>'),True,True);
    SetField(fieldCountry, Line);
  end;

end;

procedure AddMoviesTitles(Page: TStringList);
var
  LineNr: Integer;

  Line: string;
  i: Integer;
  MovieTitle, MovieAddress, Description: string;
  BeginPos, EndPos: Integer;
  begin
  LineNr := 0;
  LineNr := FindLine('<div class="block home video">',Page,LineNr);
   while LineNr > -1 do
     begin

       //Line:= GJoinMultipleLines(Page, '<div class="informazioniProdotto">','</h4>' , LineNr);
       Line := Page.GetString(LineNr);
       
       MovieAddress:= GHtmlDecodeAndClean(TextBetween(Line, '<div class="description"><h3><a href="', '"'),True,True);

       MovieTitle:= GHtmlDecodeAndClean(TextBetween(Line, '<div class="description">', '</a></h3><h4>'),True,True);

       Description := GHtmlDecodeAndClean(TextBetween(Line, '</a></h3><h4>', '</a></h4><h5>'),True,True);

       if Description = '' then Description := TextBetween(Line, 'Non disponibile', '</A>');
       if MovieTitle > '' then PickTreeAdd(MovieTitle + ' (' + Description + ')', MovieAddress);

       if TheMovieAddress='*' then
         TheMovieAddress := MovieAddress
       else
         TheMovieAddress := '';

       LineNr := FindLine('<div class="block home video">',Page,LineNr+1);

     end;
 
  LineNr := FindLine('<p style="height: auto;" class="pagine">',Page,LineNr);
  Line := Page.GetString(LineNr);

  Line := TextBetween(Line, '<p style="height: auto;" class="pagine">', '</p>');

  BeginPos := pos('href',Line);
  if BeginPos>0 then
  begin
    Delete(Line,1,BeginPos + 5);
    EndPos := pos('"',Line);
    MovieAddress := copy(Line,1,EndPos-1);

    PickTreeMoreLink('http://www.lafeltrinelli.it' + GHtmlDecode(MovieAddress,true));
  end;
  if TheMovieAddress='*' then TheMovieAddress := '';
end;

// -----------------------------
// Questo è il main dello script
// -----------------------------
begin
  if CheckVersion(3,5,0) then
   begin
   
   NewGiLib;
    TheMovieAddress := '*';
    MovieName := StringReplace(GetField(fieldTranslatedTitle), '.', ' ');
    if MovieName = '' then
      MovieName := StringReplace(GetField(fieldOriginalTitle), '.', ' ');
   While pos ('[', MovieName) > 0 Do begin
   MovieName := TextBefore(MovieName, '[', '') + TextAfter(MovieName, ']');
   end;
    if Input('LaFeltrinelli Importazione Film', 'Digitare il titolo del film / Codice a Barre:', MovieName) then
    begin
      AnalyzePage(UrlBase + '/fcom/it/home/pages/catalogo/searchresults.html?prkw='+UrlEncode(MovieName)+'&srch=' + IntToStr(GetOption('CercaTitoloEsatto')) + '&Cerca.x=0&Cerca.y=0&cat1=5&prm=');
    end;
   FinalizeGiLib;
   end
  else
    ShowMessage('Questo script richiede una versione più nuova di Ant Movie Catalog (almeno la versione 3.5.0)');
end. 

Posted: 2013-08-26 09:19:03
by antp
Thanks

Posted: 2013-11-07 12:44:22
by YoungBoy
@fulvio53s03 don't work for me

---

@fulvio53s03 per me non funziona, da sempre movie not found. Ho provato a darci un'occhiata ma il sito feltrinelli è completamente cambiato e non riesco a trovare una soluzione

Posted: 2013-11-09 19:07:54
by YoungBoy
The problem is TStringList and PickTreeClear, but I don't know as repair it

Posted: 2013-11-11 07:48:58
by fulvio53s03