English > Scripts and Templates

Script: FilmAffinity [ES] (Easy Script)

(1/21) > >>

VVV_Easy_Programing:
I attached my script to scrape the information of the web Spanish FilmAffinity. If you want to try use the name of movies in Spanish  "La vida de Pi"="Life of Pi" (finds at first) or "Padrino"="Godfather" to search by list (the script no handles advanced search).
On the other hand I tried to make it as easy as possible to understand for subsequent public use. It also includes an example so that it can adapt. I copy the introduction of Script:
"  This is a script designed to be easy to understand and to adapt. For this reason may be missing some fields and
  the programming may not be smart. It's a only "One Pass" Script and get data in WEB SECUENTIAL ORDER.
  The Personal Video Data field names in comments are enclosed in "~" so they are easier to find in the script.
  The WEB_SPECIFIC comentary points out the specific text for Web fields.
  Use with your editor's search function to find applicable code sections and adapt script."
 (Edito: New version down)

VVV_Easy_Programing:
v 0.1.1.0   VVV: Minor corrections and ameliorations

Ivek23:
Script works fine, but does have some drawbacks, namely:

1.  Instead of this
--- Code: ---  //Get ~Duration~. (User option GET_DURATION)
    if GET_DURATION then begin
      PVDField:='duration';
.
.
.
--- End code ---
must be as follows

--- Code: ---  //Get ~Duration~. (User option GET_DURATION)
    if GET_DURATION then begin
      PVDField:='length';
.
.
.
--- End code ---
duration is incorrectly displayed

--- Code: ---web page           PVD field
91 min                0:01:31
152 min              0:02:33

--- End code ---
proper duration is as follows

--- Code: ---web page           PVD field
91 min                1:31:00
152 min              2:32:00

--- End code ---


2.  Year in some movies do not pass, here are some links:
http://www.filmaffinity.com//es/film485513.html
http://www.filmaffinity.com//es/film642021.html
http://www.filmaffinity.com//es/film345561.html
http://www.filmaffinity.com//es/film557483.html

3.  Genre in some movies is not transferred correctly, here are a few links:
http://www.filmaffinity.com//es/film560132.html
--- Quote ---Drama, Romance, Premios                1962, 1962, CrÍticas                                                                   La maravillosa novela de Nabokov tuvo una excelent, Kubrick se atreve con la turbulenta relación de un padrastro y su hija adolescente, creando una película bella, sugerente y desgarradora sobre la perversa obsesión de la naturaleza humana. La polémica ya estaba servida de antemano, pero el arte acalló las voces religiosas que se levantaron contra su exhibición. Muy buena.                     Pablo Kurt: F, vigoroso y arriesgado ejercicio de puesta en pantalla que nos abre al Kubrick en plena posesión de su talento"               , La maravillosa novela de Nabokov tuvo una excelente adaptación cinematográfica a cargo de otro maestro singular. Así, Pablo Kurt: FILMAFFINITY                                                                            "Gran cine e inteligente, "Gran cine e inteligente, Ángel Fdez. Santos: Diario El País, Puedes hacer una crÍtica de esta pelÍcula para que el resto de los usuarios la pueda leer.            AÑade tu crÍtica, AÑade tu crÍtica, Votaciones de almas gemelas                                        RegÍstrate, RegÍstrate, PosiciÓn rankings listas                                                55 Mis adaptaciones de libros / novelas preferidas, 55 Mis adaptaciones de libros / novelas preferidas, Mis adaptaciones de libros / novelas preferidas, Las películas más eróticas que recuerdo, Mis películas británicas & irlandesas favoritas (NUEVA LISTA), Si alguna sinopsis cuenta demasiados detalles del argumento -o para corregir errores o completar datos de la ficha- por favor, mensaje, AÑade FA a tus webs favoritas, FA en Facebook
--- End quote ---
http://www.filmaffinity.com//es/film619271.html

--- Quote ---Terror, http://www.theasylum.cc/product.php?id=229, Puedes hacer una crÍtica de esta pelÍcula para que el resto de los usuarios la pueda leer.            AÑade tu crÍtica, AÑade tu crÍtica, Votaciones de almas gemelas                                        RegÍstrate, RegÍstrate, Si alguna sinopsis cuenta demasiados detalles del argumento -o para corregir errores o completar datos de la ficha- por favor, mensaje, AÑade FA a tus webs favoritas, FA en Facebook
--- End quote ---

VVV_Easy_Programing:
Thank you very much for your work. I think I've corrected the mistakes you point me:

v 0.1.2.0   VVV: Corrections: Duration (field name and length in seconds), genres (movies without category).
                         Improvements: RemoveTags (Simplify the Web delimitators choice)

(The year works fine now without knowing why)
Attached the new version

Ivek23:

--- Quote from: VVV_Easy_Programing on January 19, 2014, 07:45:34 pm ---(The year works fine now without knowing why)
--- End quote ---

Hi, I think I found a solution for year movie, I tested a few movies and it works fine (see attached image).

Here is the solution:

--- Code: ---procedure ParseMovie(HTML:String;MovieURL:AnsiString);
  var
    curPos,endPos:Integer;
    PVDField,Years,WebFieldText,WebFieldOpen,WebFieldBegin,WebFieldEnd,WebItemBegin,WebItemEnd:String;
  begin
    LogMessage('procedure ParseMovie');
.
.
.
  //Get ~year~
    PVDField:='year';                           //For easy programation
    WebFieldText:='      Year:';                //Only for Debuging
    WebFieldOpen:='<dt>Ańo</dt>';               //Web only one value. WEB_SPECIFIC
    WebFieldBegin:='<dd>';                      //WEB_SPECIFIC
    WebFieldEnd:='</dd>';                       //WEB_SPECIFIC
endPos:=endPos+Length(WebFieldOpen);
    curPos:=PosFrom(WebFieldBegin,HTML,curPos)+Length(WebFieldBegin);
    endPos:=PosFrom(WebFieldEnd,HTML,curPos);
    Years:= Copy(HTML,curPos,endPos - curPos);
    //curPos:=GetPVDFieldOneValue(HTML,curPos,PVDField,WebFieldText,WebFieldOpen,WebFieldBegin,WebFieldEnd);
    AddFieldValueXML(PVDField,Years);
    LogMessage('    Years:'+Years+'||'+PVDField);

  //Get ~Lenght~. (User option GET_LENGTH)
.
.
.
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version