Is there a way to make the scripts a bit more automated? :)
-
- Posts: 7
- Joined: 2002-10-14 04:35:43
MMmmm I've got often 2 kind of error message with this wonderfull batch script ...
The first is : "Script error IMDB at position 7515 (out of range)"
It's at the
// Rating
if ImportRating then
begin
LineNr := FindLine('User Rating:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr + 4);
if Pos('awaiting', Line) = 0 then
begin
BeginPos := pos('<b>', Line) + 3;
Value := IntToStr(Round(StrToInt(StrGet(Line, BeginPos), 0) + (StrToInt(StrGet(Line, BeginPos + 2), 0) / 10)));
SetField(fieldRating, Value);
end;
end;
end;
The second is a Time Out error even with a greater value for the sleep ... What's wrong doctor ?
Thx for all this improvements
The first is : "Script error IMDB at position 7515 (out of range)"
It's at the
// Rating
if ImportRating then
begin
LineNr := FindLine('User Rating:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr + 4);
if Pos('awaiting', Line) = 0 then
begin
BeginPos := pos('<b>', Line) + 3;
Value := IntToStr(Round(StrToInt(StrGet(Line, BeginPos), 0) + (StrToInt(StrGet(Line, BeginPos + 2), 0) / 10)));
SetField(fieldRating, Value);
end;
end;
end;
The second is a Time Out error even with a greater value for the sleep ... What's wrong doctor ?
Thx for all this improvements
-
- Posts: 7
- Joined: 2002-10-14 04:35:43
yeah that error seems to occur when the script runs into a movie with less than 5 votes, or whatever that is, where the IMDB doesn't have enough votes to have a rating yet. Those movies give the error, for instance:
http://amazon.imdb.com/Title?0293555
and yeah the last problem is still the connection errors that come on occassion, although less than before (since the sleep).
is there a way to retry or automaticalled have it choose "ok" on those?
THANKS again, this is awesome
http://amazon.imdb.com/Title?0293555
and yeah the last problem is still the connection errors that come on occassion, although less than before (since the sleep).
is there a way to retry or automaticalled have it choose "ok" on those?
THANKS again, this is awesome
search for the line
and remplace it by
Code: Select all
if Pos('awaiting', Line) = 0 then
Code: Select all
if Pos('/10', Line) > 0 then
phaelox' script
your script is very usefull I hate all those questions...
I tryed to modify it a bit:
when the URL is already set than get that page, don't search by the title...
////////////////////////
....
IMDBlink := GetField(fieldURL);
if IMDBlink<>'' then
begin
AnalyzePage(IMDBlink);
end else begin
MovieName := GetField(fieldOriginalTitle);
....
/////////////////////////////
but the problem is that fieldURL always returns an empty string even if it is not.
Can anyone tell me where am I wrong?
I tryed to modify it a bit:
when the URL is already set than get that page, don't search by the title...
////////////////////////
....
IMDBlink := GetField(fieldURL);
if IMDBlink<>'' then
begin
AnalyzePage(IMDBlink);
end else begin
MovieName := GetField(fieldOriginalTitle);
....
/////////////////////////////
but the problem is that fieldURL always returns an empty string even if it is not.
Can anyone tell me where am I wrong?
Thank you for your time, I appreciate your work and providing the catalog structure was very useful for me... I'm working on a PHP script that reads the info from the catalog and generates a html(hope to be able to implement the generation from the already existent templates). I think it is a better idea than exporting in hundreds of htmls... of course it needs a server with PHP.
That's not a problem, I give it to you once I finish it, but I am very busy in these days and don't have too much time to spend with it, but I'll do my best
I only have one questions regarding the structure... I wasn't able to figure out how you store the date...
I read a number like 37555 and have no idea how it will become 10/26/2002.
I only have one questions regarding the structure... I wasn't able to figure out how you store the date...
I read a number like 37555 and have no idea how it will become 10/26/2002.
well i think that is sometinig missing in this batch script...
maybe im wrong but pictures cant be imported...maybe couse of this:
batch code:
// Picture
if ImportPicture then
begin
LineNr := FindLine('<img alt="cover" align="left" src="http://posters.imdb.com/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://images.amazon.com/', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := pos('"', Line);
Value := copy(Line, 1, EndPos - 1);
if ImportLargePicture then
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
and normal (pic) code:
// Picture
if ImportPicture then
begin
LineNr := FindLine('<img alt="cover" align="left" src="http://ia.imdb.com/media/imdb/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://posters.imdb.com/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://images.amazon.com/', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := pos('"', Line);
Value := copy(Line, 1, EndPos - 1);
if ImportLargePicture then
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
as u can see is missing http://ia.imdb.com/media/imdb/ ...and pictures cant be grabed from there...
i hope this could help
maybe im wrong but pictures cant be imported...maybe couse of this:
batch code:
// Picture
if ImportPicture then
begin
LineNr := FindLine('<img alt="cover" align="left" src="http://posters.imdb.com/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://images.amazon.com/', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := pos('"', Line);
Value := copy(Line, 1, EndPos - 1);
if ImportLargePicture then
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
and normal (pic) code:
// Picture
if ImportPicture then
begin
LineNr := FindLine('<img alt="cover" align="left" src="http://ia.imdb.com/media/imdb/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://posters.imdb.com/', Page, 0);
if LineNr < 0 then
LineNr := FindLine('<img alt="cover" align="left" src="http://images.amazon.com/', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := pos('"', Line);
Value := copy(Line, 1, EndPos - 1);
if ImportLargePicture then
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
as u can see is missing http://ia.imdb.com/media/imdb/ ...and pictures cant be grabed from there...
i hope this could help
Code: Select all
Code: Select all
Code: Select all