BETA FIX - Imdb Large Pics
BETA FIX - Imdb Large Pics
antp
the solution below has worked with all of the movies i've tried. i hope you could test it, to have it "certified"
// Picture
LineNr := FindLine('title="DVD available at Amazon.com"', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := Pos('href="', Line) + 5;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
AmazonPage := TStringList.Create;
AmazonPage.Text := GetPage('http://us.imdb.com' + Value);
LineNr := FindLine('<title>Amazon.com: DVD Search', AmazonPage, 0);
if LineNr < 1 then
begin
LineNr := FindLine('img src="http://images.amazon.com/images/P/', AmazonPage, 0);
if LineNr > -1 then
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('img src="http://images.amazon.com/images/P/', Line) + 8;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'TZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end
end else
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('<title>Amazon.com: DVD Search Results: ', Line) + 38;
Delete(Line, 1, BeginPos);
EndPos := Pos('|', Line);
Value2 := Copy(Line, 1, EndPos - 1);
Value := 'http://images.amazon.com/images/P/' + Value2 + '.01.LZZZZZZZ.jpg';
GetPicture(Value, False);
end;
AmazonPage.Free;
end else
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);
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // change URL to get the Large instead of Small image
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
the solution below has worked with all of the movies i've tried. i hope you could test it, to have it "certified"
// Picture
LineNr := FindLine('title="DVD available at Amazon.com"', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := Pos('href="', Line) + 5;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
AmazonPage := TStringList.Create;
AmazonPage.Text := GetPage('http://us.imdb.com' + Value);
LineNr := FindLine('<title>Amazon.com: DVD Search', AmazonPage, 0);
if LineNr < 1 then
begin
LineNr := FindLine('img src="http://images.amazon.com/images/P/', AmazonPage, 0);
if LineNr > -1 then
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('img src="http://images.amazon.com/images/P/', Line) + 8;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'TZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end
end else
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('<title>Amazon.com: DVD Search Results: ', Line) + 38;
Delete(Line, 1, BeginPos);
EndPos := Pos('|', Line);
Value2 := Copy(Line, 1, EndPos - 1);
Value := 'http://images.amazon.com/images/P/' + Value2 + '.01.LZZZZZZZ.jpg';
GetPicture(Value, False);
end;
AmazonPage.Free;
end else
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);
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // change URL to get the Large instead of Small image
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
-
- Posts: 2
- Joined: 2002-12-18 12:25:26
- Location: Darkest Africa
BETA FIX - Imdb Large Pics
sorry ... u need to declare the variable at the top of the script :
before
procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value, Value2, FullValue: string;
LineNr: Integer;
BeginPos, EndPos: Integer;
after
procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value, Value2, FullValue: string;
LineNr: Integer;
BeginPos, EndPos: Integer;
AmazonPage: TStringList;
before
procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value, Value2, FullValue: string;
LineNr: Integer;
BeginPos, EndPos: Integer;
after
procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value, Value2, FullValue: string;
LineNr: Integer;
BeginPos, EndPos: Integer;
AmazonPage: TStringList;
-
- Posts: 2
- Joined: 2002-12-18 12:25:26
- Location: Darkest Africa
BETA FIX UPDATE - Imdb Large Pics
i changed the parsing of the amazon page, to make the script more accurate ....
// Picture
LineNr := FindLine('title="DVD available at Amazon.com"', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := Pos('href="', Line) + 5;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
AmazonPage := TStringList.Create;
AmazonPage.Text := GetPage('http://us.imdb.com' + Value);
// if Pos('<TITLE>Amazon.com: DVD Search', AmazonPage.Text) = 0 then
LineNr := FindLine('<b>1.', AmazonPage, 0);
if LineNr < 1 then
begin
LineNr := FindLine('img src="http://images.amazon.com/images/P/', AmazonPage, 0);
if LineNr > -1 then
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('img src="http://images.amazon.com/images/P/', Line) + 8;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'TZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end
end else
begin
LineNr := FindLine('http://images.amazon.com/images/P/', AmazonPage, LineNr);
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'THUMBZZZ', 'LZZZZZZZ');
GetPicture(Value, False);
end;
AmazonPage.Free;
end else
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);
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // change URL to get the Large instead of Small image
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
// Picture
LineNr := FindLine('title="DVD available at Amazon.com"', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := Pos('href="', Line) + 5;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
AmazonPage := TStringList.Create;
AmazonPage.Text := GetPage('http://us.imdb.com' + Value);
// if Pos('<TITLE>Amazon.com: DVD Search', AmazonPage.Text) = 0 then
LineNr := FindLine('<b>1.', AmazonPage, 0);
if LineNr < 1 then
begin
LineNr := FindLine('img src="http://images.amazon.com/images/P/', AmazonPage, 0);
if LineNr > -1 then
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('img src="http://images.amazon.com/images/P/', Line) + 8;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'TZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end
end else
begin
LineNr := FindLine('http://images.amazon.com/images/P/', AmazonPage, LineNr);
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'THUMBZZZ', 'LZZZZZZZ');
GetPicture(Value, False);
end;
AmazonPage.Free;
end else
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);
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // change URL to get the Large instead of Small image
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
BETA FIX UPDATE - Imdb Large Pics
ok .. here it goes
Code: Select all
// Picture
LineNr := FindLine('title="DVD available at Amazon.com"', Page, 0);
if LineNr > -1 then
begin
Line := Page.GetString(LineNr);
BeginPos := Pos('href="', Line) + 5;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
AmazonPage := TStringList.Create;
AmazonPage.Text := GetPage('http://us.imdb.com' + Value);
// if Pos('<TITLE>Amazon.com: DVD Search', AmazonPage.Text) = 0 then
LineNr := FindLine('<b>1.', AmazonPage, 0);
if LineNr < 1 then
begin
LineNr := FindLine('img src="http://images.amazon.com/images/P/', AmazonPage, 0);
if LineNr > -1 then
begin
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('img src="http://images.amazon.com/images/P/', Line) + 8;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'TZZZZZZZ', 'LZZZZZZZ');
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end
end else
begin
LineNr := FindLine('http://images.amazon.com/images/P/', AmazonPage, LineNr);
Line := AmazonPage.GetString(LineNr);
BeginPos := Pos('src="', Line) + 4;
Delete(Line, 1, BeginPos);
EndPos := Pos('"', Line);
Value := Copy(Line, 1, EndPos - 1);
Value := StringReplace(Value, 'THUMBZZZ', 'LZZZZZZZ');
GetPicture(Value, False);
end;
AmazonPage.Free;
end else
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);
Value := StringReplace(Value, 'MZZZZZZZ', 'LZZZZZZZ'); // change URL to get the Large instead of Small image
GetPicture(Value, False); // False = do not store picture externally ; store it in the catalog file
end;
end;
-
- Posts: 10
- Joined: 2002-12-20 22:47:05