Need Script for http://www.ita-bol.com

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
TanATos
Posts: 5
Joined: 2004-02-29 13:16:35

Need Script for http://www.ita-bol.com

Post by TanATos »

Hi !!
Can someone help me an make this script ?

http://www.ita-bol.com/bol/main.jsp?action=vidtrova1

I need to keeep all information...

Thanks in advance
Chris

Post by Chris »

bisogna costruire uno script che va a leggere i risultati della ricerca di questa pagina:
http://www.ita-bol.com/bol/main.jsp?act ... olachiave= + la stringa cercata

ci posso provare, mi vado a rileggere gli appunti che ho usato per creare gli script per Yahoo italia e cinematografo e vedo che posso fare :E

ciao, Chris
TanATos
Posts: 5
Joined: 2004-02-29 13:16:35

Post by TanATos »

Grazie mille !!!!
Purtroppo io sono negato in programmazione.

:D
Guest

Post by Guest »

Non è lo stato dell'arte ma funziona. Non prende la categoria del film perchè questa non è esplicita nella pagina ma generata in qualche modo in javascript. Il paese invece lo prende solo a volte, non capisco perchè :??:

Code: Select all

// GETINFO SCRIPTING
// Ita-Bol.com (IT)

(***************************************************
*  Movie importation script for:                  *
*  Ita-Bol.com (IT), http://www.ita-bol.com       *
*                                                 *
* (c) 2004 Andrea Cristaudo achris@tiscalinet.it  *
*                                                 *
*  For use with Ant Movie Catalog 3.4.1           *
*  www.ant.be.tf/moviecatalog ··· www.buypin.com  *
*                                                 *
*  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               *
***************************************************)

program ItaBol;
var MovieName: string;
    TheMovieAddress: string;
    SearchPage: 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;

function RemoveExtraSpaces(Stringa: string): string;
var i: integer;
begin
  while Pos('  ', Stringa) <> 0 do
    begin
      i:=Pos('  ', Stringa);
      Delete(Stringa, i, 1);
    end;
  if Pos(' ', Stringa) = 1 then Delete(Stringa, 1, 1);
  result:= Stringa;
end;

function RemoveWord(Stringa, Remove: string): string;
var position: integer;
begin
  position := Pos(Remove, Stringa);
  while position <> 0 do
    begin
      position := Pos(Remove, Stringa);
      Delete(Stringa, position, length(Remove));
    end;
  result:=Stringa;
end;

procedure AnalyzeSearchPage(Address: string);
var Page:     TStringList;
    LineNr:   integer;
    BeginPos: integer;
begin
  Page := TStringList.Create;
  Page.Text := GetPage(Address);
  LineNr := FindLine(' Non abbiamo trovato dei prodotti che rispondono ai tuoi criteri di ricerca', Page, 0);
  if LineNr <> -1 then
    begin
      ShowMessage('Nessun film trovato');
    end
  else
    begin
      PickTreeClear;
      AddMoviesTitles(Page);
      if TheMovieAddress='*' then
        begin
          if PickTreeExec(Address) then
            begin
              SetField(fieldURL, Address);
              Page.Text := GetPage(Address);
              AnalyzeMoviePage(Page);
            end;
        end
      else
        begin
          SetField(fieldURL, TheMovieAddress);
          Page.Text := GetPage(TheMovieAddress);
          AnalyzeMoviePage(Page);
        end;
    end;
  Page.Free;
end;

procedure AddMoviesTitles(Page: TStringList);
var LineNr, NewLineNr: Integer;
    Line: string;
    MovieTitle, MovieAddress: string;
    BeginPos, EndPos: Integer;
    Conta: Integer;
begin
  Conta:=0;
  LineNr := FindLine('        <font class="Testo">', Page, LineNr);
  while LineNr <> -1 do
    begin
      // Indirizzo Scheda
      Line := Page.GetString(LineNr+1);
      BeginPos := pos('<a href="', Line) + 9;
      EndPos := pos('">',Line);
      MovieAddress := 'http://www.ita-bol.com' + copy(Line, BeginPos, EndPos-BeginPos);

      // Titolo
      Line := Page.GetString(LineNr+2);
      BeginPos := pos('<b>', Line);
      EndPos   := pos('</b>', Line);
      MovieTitle := copy(Line, BeginPos, EndPos-BeginPos);
      HTMLRemoveTags(MovieTitle);
      HTMLDecode(Movietitle);

      PickTreeAdd(MovieTitle, MovieAddress);

      LineNr := FindLine('        <font class="Testo">',Page,LineNr+3);
      Conta:=Conta+1;
    end;
    if Conta > 1 then TheMovieAddress := '*'
    else TheMovieAddress := MovieAddress;
    
end;


procedure AnalyzeMoviePage(Page: TStringList);
var i, j: Integer;
    Line: string;
    LineNr: Integer;
    BeginPos, EndPos: Integer;
    Actors, ImgUrl: string;
begin
  Actors := '';
  LineNr := FindLine('<font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#3366CC"><b>', Page, 0);
  if LineNr > -1 then
    begin
      //Translated Title
      LineNr := LineNr + 1;
      Line := Page.GetString(LineNr);
      Delete(Line, 1, 24);
      EndPos := pos('</b>', Line);
      HTMLRemoveTags(Line);
      SetField(fieldTranslatedTitle, copy(Line, 1, EndPos-1));

      for i:= LineNr to Page.Count-1 do
       begin
         Line := Page.GetString(i);

         // Original Title
         if Pos('Titolo originale :', Line) > 0 then
           begin
             HTMLRemoveTags(Line);
             Delete(Line, 1, 46);
             SetField(fieldOriginalTitle, Line);
           end

         // Director
         else if Pos('<br>Regia : ', Line) > 0 then
           begin
             HTMLRemoveTags(Line);
             Delete(Line, 1, 36);
             SetField(fieldDirector, Line);
           end

         // Length, Producer, Year
         else if Pos('<!--fine include torna la parte prezzo-->', Line) > 0 then
           begin
             // Length
             Line := Page.GetString(i+7);
             Line := RemoveWord(Line, ' ');
             Line := RemoveWord(Line, '|');
             Line := RemoveWord(Line, 'Min.');
             SetField(fieldLength, Line);

             // Producer
             Line := Page.GetString(i+8);
             Line := RemoveWord(Line, ' ');
             SetField(fieldProducer, RemoveExtraSpaces(Line));

             // Year
             Line := Page.GetString(i+9);
             Line := RemoveWord(Line, ' ');
             Line := RemoveWord(Line, '|');
             SetField(fieldYear, RemoveExtraSpaces(Line));
           end

         // Description
         else if Pos('<b><a name="TRAMA">Trama:</a></b>', Line) > 0 then
           begin
             Line := Page.GetString(i+17);
             HTMLRemoveTags(Line);
             SetField(fieldDescription, Line);
           end

         // Actors
         else if Pos('/bol/main.jsp?action=vidlibri&tipoContrib=A1&codPers=', Line) > 0 then
           begin
             HTMLRemoveTags(Line);
             Actors := Actors + ', ' + RemoveExtraSpaces(Line);
           end
         else if Pos('<a name="CAST">Cast:</a>', Line) > 0 then
           Actors := ''

         // Picture
         else if Pos('<img src="/bol/includes/tornaImmagine.jsp?cdSoc=BL&ean=', Line) > 0 then
           begin
             ImgUrl := 'http://www.ita-bol.com';
             j:= Pos('<img src="/bol/includes/tornaImmagine.jsp?cdSoc=BL&ean=', Line);
             Delete(Line, 1, j+9);
             ImgUrl := ImgUrl+Line;
             Line := Page.GetString(i+1);
             j:= Pos('"', Line);
             ImgUrl := ImgUrl+Copy(Line, 1, j-1);
             GetPicture(ImgUrl, true);
           end

         // Country
         else if Pos('<B>Produzione:', Line) > 0 then
           begin
             HTMLRemoveTags(Line);
             j:= Pos(' ', Line);
             Delete(Line, 1, j+6);
             j:= Pos(' ', Line);
             if j > 0 then
               begin
                 Delete(Line, 1, j+5);
                 j:= Pos(' ', Line);
                 if j > 0 then
                   begin
                     Line := Copy(Line, 1, j-1);
                     SetField(fieldCountry, Line);
                   end;
               end;
           end;

       end;

       Delete(Actors, 1, 2);
       SetField(fieldActors, RemoveExtraSpaces(Actors));
    end;
  DisplayResults;
end;


begin
  if CheckVersion(3,4,1) then
    begin
      SearchPage := 'http://www.ita-bol.com/bol/main.jsp?action=vidrisultatoricerca&quick_type=Titolo&filtro_ricerca=VID&titolo=';

      MovieName := GetField(fieldTranslatedTitle);
      if MovieName = '' then
        MovieName := GetField(fieldOriginalTitle);
      if Input('Ita-Bol.com Import', 'Enter the title of the movie:', MovieName) then
        AnalyzeSearchPage(SearchPage+UrlEncode(MovieName));
    end
  else
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.1)');
end.
[/code]
robgarib
Posts: 6
Joined: 2003-12-02 18:49:31

Post by robgarib »

C'è la possibilità di fare lo script per il sito di AF Digitale.it?
Grazie

http://www.afdigitale.it/edisport/afdig ... enframeset



It's possible to make the script for AF Digitale.it? Thanks

http://www.afdigitale.it/edisport/afdig ... enframeset
TanATos
Posts: 5
Joined: 2004-02-29 13:16:35

Post by TanATos »

Thanks !!!!!!!!!!!!!!!!!
:hihi:

Is possible to get more information ???
For example:

Audio Format, Language,Subtitles,....

:grinking:
Post Reply