IMDB Import doesn't work anymore
find doesn't work
Doesn't work if your name matches more than one movie. Try new Texas Chainsaw Massacre. So I guess 'find' script doesn't work well.
Here are the updated scripts :
http://www.antp.be/temp/IMDB.ifs
http://www.antp.be/temp/IMDB%20(pic).ifs
http://www.antp.be/temp/IMDB%20(large%20pic).ifs
http://www.antp.be/temp/IMDB%20(batch).ifs
If you find movies that show IMDB-related errors (i.e. no about pictures not found on Amazon), do not hesitate to post their title
http://www.antp.be/temp/IMDB.ifs
http://www.antp.be/temp/IMDB%20(pic).ifs
http://www.antp.be/temp/IMDB%20(large%20pic).ifs
http://www.antp.be/temp/IMDB%20(batch).ifs
If you find movies that show IMDB-related errors (i.e. no about pictures not found on Amazon), do not hesitate to post their title
Hi, I've noticed that on some movies I get: "<a href="plotsummary">(more)</a" at the end of the description. I'm using the http://www.antp.be/temp/IMDB%20(pic).ifs linked on this post with short description (DescriptionToImport = 1; ).
I've investigated a bit and noticed that this happens on pages where the string "Plot Summary:" is found (i.e. for "Prey for Rock & Roll" movie), but not on the ones that it is used instead the "Plot Outline:" (i.e. Gladiator (2002)). Tried to change some things to make it work but can't do it... nor found the answer searching the forums.
Edit: Trying and trying, guessing and guessing, I manage to make it work.
As I'm not a programmer I'm not sure if this is correct or is the orthodox way to have it done. Viewing the source of pages in which it didn't work (with plot summary) I saw that the "<a href" (looked in EndPos := pos('<a href', Line); ) was on a new line. So I added the following code to the script after it looked for '<a href' on the same line, but before it looked for '<br><br>' (added and not replaced since I'm not sure if all the "plot summary" ones have the "<a href="plotsummary">(more)</a" on a new line):
if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<a href', Line);
...
...
end;
So the final description code is:
Please correct me if I'm wrong.
Best regards,
Mguel
I've investigated a bit and noticed that this happens on pages where the string "Plot Summary:" is found (i.e. for "Prey for Rock & Roll" movie), but not on the ones that it is used instead the "Plot Outline:" (i.e. Gladiator (2002)). Tried to change some things to make it work but can't do it... nor found the answer searching the forums.
Edit: Trying and trying, guessing and guessing, I manage to make it work.
As I'm not a programmer I'm not sure if this is correct or is the orthodox way to have it done. Viewing the source of pages in which it didn't work (with plot summary) I saw that the "<a href" (looked in EndPos := pos('<a href', Line); ) was on a new line. So I added the following code to the script after it looked for '<a href' on the same line, but before it looked for '<br><br>' (added and not replaced since I'm not sure if all the "plot summary" ones have the "<a href="plotsummary">(more)</a" on a new line):
if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<a href', Line);
...
...
end;
So the final description code is:
Code: Select all
//Description
LineNr := FindLine('Plot Summary:', Page, 0);
if LineNr < 1 then
LineNr := FindLine('Plot Outline:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('</b>', Line) + 5;
EndPos := pos('<a href', Line);
if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<a href', Line);
if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<br><br>', Line);
if EndPos < 1 then
EndPos := Length(Line);
end;
end;
Value := copy(Line, BeginPos, EndPos - BeginPos);
HTMLDecode(Value);
case DescrImport of
0:
begin
PickListClear;
PickListAdd(Value);
GetDescriptions(GetField(fieldURL) + 'plotsummary');
if PickListExec('Select a description for "' + MovieName + '"', Value) then
SetField(fieldDescription, Value);
end;
1:
SetField(fieldDescription, Value);
2:
SetField(fieldDescription, GetDescriptions(MovieURL + 'plotsummary'));
end;
end;
Best regards,
Mguel
hmmm so in some case you get 3 lines ? It may be a problem.
I think it would be better to correct the script this way :
I think it would be better to correct the script this way :
Code: Select all
//Description
LineNr := FindLine('Plot Summary:', Page, 0);
if LineNr < 1 then
LineNr := FindLine('Plot Outline:', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := pos('</b>', Line) + 5;
EndPos := pos('<a href', Line);
if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<br><br>', Line);
if EndPos < 1 then
EndPos := pos('<a href', Line);
if EndPos < 1 then
EndPos := Length(Line);
end;
Value := copy(Line, BeginPos, EndPos - BeginPos);
[...]etc.
Thanks for the code and explanation!
You're right, I use 3.4.2. I didn't update since the changelog was a bug fix with some P4 (which I don't have) and 3.4.2 was working fine for me, so wanted to wait for another release to update.
Nevertheless, for the next time, I'll update the scripts at least (I thought the ones linked here where the latest).
Regards,
Mguel
You're right, I use 3.4.2. I didn't update since the changelog was a bug fix with some P4 (which I don't have) and 3.4.2 was working fine for me, so wanted to wait for another release to update.
Nevertheless, for the next time, I'll update the scripts at least (I thought the ones linked here where the latest).
Regards,
Mguel