Filmaffinity (ES): Category updated

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
MrK
Posts: 4
Joined: 2005-10-03 19:43:49

Filmaffinity (ES): Category updated

Post by MrK »

hi

the old script didnt take the category. (It did, not in the category field but
in description one)
it's a bit tricky because in the spanish version of the site
the category is embbebed in the description, and not always in the same position.
example:
1967: 1 Oscar mejor director. Nominada secundaria Katherine Ross / Drama / SINOPSIS: ......

or could be at the begining:
Drama / El Coronel espera. Le prometieron...........

so the scripts try to get the category between /.../
if there is only one / , it will get all the description text from the "/"

So the script check if lenght is too long, and in that case gets
from the beginning to the only "/"
(since i have seen categories of 65 characters, i put a limit of 100)

It works most of the times, but sometimes there is no "/" at all,
so in that rare cases won't.

the only change in the previous version is that this
piece of code is added.

Code: Select all

// Category
  LineNr := FindLine('GÉNERO Y CRÍTICA', Page, 0);
  if LineNr <> -1 then
  begin
    Line := Page.GetString(LineNr + 1);
    Item := TextBetween (Line, ' / ', ' / ');
   if Length(Item)> 100 then
     begin
        Line := Page.GetString(LineNr + 1);
        Item := TextBetween (Line, '<td  >', ' /');
     end;
    HTMLDecode(Item);
    SetField(fieldCategory, Trim (Item));
  end;

that's it!


you can find it here

http://personales.ya.com/filiprim/FilmA ... 0(ES).ifs

enjoy & congratulations antoine!
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Thanks :)
Post Reply