Is there a way to make the scripts a bit more automated? :)

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.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Yes, I may add that
But I haven't lots of time for that currently.
It is not a heavy change so I will try to add that this weekend (at least a "sleep" function)
phaelox
Posts: 15
Joined: 2002-10-08 20:37:22

Post by phaelox »

ok, thanks.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I updated the program, and added the "sleep" function
I added it in the "IMDB (batch)" script included with the update.
phaelox
Posts: 15
Joined: 2002-10-08 20:37:22

Post by phaelox »

way to go, thanks :cool:
SuperflyTNT
Posts: 7
Joined: 2002-10-14 04:35:43

Post by SuperflyTNT »

wow, man what can I say but thank you!!! mannn, thanks for the support ya guyz give in this forum ;) phae and antp you guyz kick ass! ;)
Guest

Post by Guest »

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
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

For the first one, could you say me with which movie you get the error ?

For the second one, I cannot really help, I guess that it is a poor connection that causes this, you may try at a different time of the day, when IMDB server receives less requests.
SuperflyTNT
Posts: 7
Joined: 2002-10-14 04:35:43

Post by SuperflyTNT »

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 ;)
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

search for the line

Code: Select all

if Pos('awaiting', Line) = 0 then
and remplace it by

Code: Select all

if Pos('/10', Line) > 0 then
colonelz0

Post by colonelz0 »

Waow!! Great job ;)
I just discovered the tool and the scripts. So much time saved.
Thanks guys :)
zolee

phaelox' script

Post by zolee »

your script is very usefull :grinking: 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?
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Do you call the script with "Get information -> From script" of by "Tools -> Scripting" ?
In the first case you cannot access to existing fields.
zolee
Posts: 3
Joined: 2002-11-13 12:03:13
Location: timisoara/romania

Post by zolee »

I am using "Get information -> From script". I don't know why it is not possible to access those fileds... you may have a good reason to hide them but 10x anyway... I will try "scripting". :cool:
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

It was to make the detection of modified fields more easy (so only modified fields are checked in the "Results" page)
But for next version I will try to make something better ;)
zolee
Posts: 3
Joined: 2002-11-13 12:03:13
Location: timisoara/romania

Post by zolee »

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.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I am curious, could you give me the PHP script that you made to read the file ? :)
I wanted to make one, but if you accept I could give yours with the program... (of course I will leave name or url in the header comments of the file if you want)
zolee
Posts: 3
Joined: 2002-11-13 12:03:13
Location: timisoara/romania

Post by zolee »

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.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

It's Borland's TDateTime
Since it is an Integer is it only a Date (Time = decimal part)
From Borland's help file :
The integral part of a TDateTime value is the number of days that have passed since 12/30/1899
RaceBoy

Post by RaceBoy »

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
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I should compare this batch script with the two "normal" IMDB scripts, because I forgot to update it when I updated the others, I think.
Post Reply