IMDB full genre

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
estil

IMDB full genre

Post by estil »

can some1 help how to write in script to take full genre from imdb site not only first one?? plzz
Guest

Post by Guest »

edit/change your imdb script with following

//Category
LineNr := FindLine('Genre:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr + 1);
BeginPos := pos('/">', Line) + 3;
EndPos := pos('</a>', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
HTMLDecode(Value);
SetField(fieldCategory, Value);
// Multiple categories
Value := '';
BeginPos := pos('Sections/Genres/', Line);
while BeginPos > 0 do
begin
Line := copy(Line, BeginPos+16, Length(Line)-BeginPos-17);
EndPos := pos('/">', Line);
Value := Value + ' / ' + copy(Line, 1, EndPos-1);
BeginPos := pos('Sections/Genres/', Line);
end;
Value := copy(Value,4,Length(Value)-1);
HTMLDecode(Value);
SetField(fieldCategory, Value);
end;
Bruce_

IMDB script doesn't work.

Post by Bruce_ »

I too am trying to get IMDB to retrieve the correct movie info but it's not working...I tried the suggestion as per Guest and it still just retrieves the first one it finds.

The movie I'm trying this on is Day of the Jackal, 1973 but it always pulls up the 1997 one with Bruce Willis. I've tried the other scripts but they don't import the small picture which is what I really want. It used to prompt me with a list of several choices but I guess IMDB changed and the script doesn't work well anymore.

Can someone maybe just post a full working script for IMDB or any other that works as mentioned above and has as many movies available as IMDB or more?

Thanks.
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

If it is only for one movie you can copy/paste the information manually from your webbrowser :p
Guest

Post by Guest »

For me, this is working:

//Category
LineNr := FindLine('Genre:', Page, 0);
if LineNr > -1 then
begin
FullValue := '';
Line := Page.GetString(LineNr + 1);
repeat
BeginPos := pos('">', Line) + 2;
EndPos := pos('</a>', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
if (Value <> '(more)') and (Value <> '') then
begin
if FullValue <> '' then
FullValue := FullValue + ' / ';
FullValue := FullValue + Value;
end;
Delete(Line, 1, EndPos);
until Pos('</a>', Line) = 0;
HTMLDecode(FullValue);
SetField(fieldCategory, FullValue);
end;


And similar for Country and Language
Post Reply