Filmaffinity (ES): Category updated
Posted: 2005-10-04 18:16:56
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.
that's it!
you can find it here
http://personales.ya.com/filiprim/FilmA ... 0(ES).ifs
enjoy & congratulations antoine!
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!