new script for beyazperde.com? (Turkish Movie database)
new script for beyazperde.com? (Turkish Movie database)
Can someone try to write a script for this site. I couldn't handle it. URL is as follows:
http://www.beyazperde.com/hizliarama.asp?keyword=
Thanks a lot.
Muzur
http://www.beyazperde.com/hizliarama.asp?keyword=
Thanks a lot.
Muzur
here the one i use
a quick and dirty solution by modifying the imdb script, but it works:
-------
-----------
-------
Code: Select all
// GETINFO SCRIPTING
// Imports Turkish Titles from beyazperde.com
(***************************************************
* Movie importation script for: *
* IMDB (US), http://us.imdb.com *
* *
* (c) 2002 Antoine Potten antoine@buypin.com *
* Improvements made by Danny Falkov *
* Improvements made by Kai Blankenhorn *
* *
* For use with Ant Movie Catalog 3.4.0 *
* www.ant.be.tf/moviecatalog ··· www.buypin.com *
* *
* The source code of the script can be used in *
* another program only if full credits to *
* script author and a link to Ant Movie Catalog *
* website are given in the About box or in *
* the documentation of the program *
***************************************************)
program TurkishTitle;
var
MovieName: string;
function FindLine(Pattern: string; List: TStringList; StartAt: Integer): Integer;
var
i: Integer;
begin
result := -1;
if StartAt < 0 then
StartAt := 0;
for i := StartAt to List.Count-1 do
if Pos(Pattern, List.GetString(i)) <> 0 then
begin
result := i;
Break;
end;
end;
procedure AnalyzePage(Address: string);
var
Page: TStringList;
LineNr: Integer;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
if pos('<title>beyazperde.com - H?zl? Arama', Page.Text) = 0 then
begin
SetField(fieldURL, Address);
AnalyzeMoviePage(Page)
end else
begin
PickTreeClear;
LineNr := 0;
LineNr := FindLine('<td class="metin3">Filmler</td>', Page, LineNr);
if LineNr > -1 then
begin
PickTreeAdd('Filmler', '');
AddMoviesTitles(Page, LineNr);
end;
if PickTreeExec(Address) then
AnalyzePage(Address);
end;
Page.Free;
end;
procedure AnalyzeMoviePage(Page: TStringList);
var
Line, Value, Value2, FullValue: string;
LineNr: Integer;
BeginPos, EndPos: Integer;
begin
// Original Title & Year
LineNr := FindLine('<title>beyazperde.com - ', Page, 0);
Line := Page.GetString(LineNr);
if LineNr > -1 then
begin
BeginPos := pos('<title>beyazperde.com - ', Line);
if BeginPos > 0 then
BeginPos := BeginPos + 24;
EndPos := pos(' / ', Line);
if EndPos = 0 then
EndPos := Length(Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
HTMLDecode(Value);
SetField(fieldTranslatedTitle, Value);
end;
SetField(fieldOriginalTitle, '');
SetField(fieldUrl, '');
DisplayResults;
end;
procedure AddMoviesTitles(Page: TStringList; var LineNr: Integer);
var
Line: string;
MovieTitle, MovieAddress: string;
StartPos: Integer;
TempPos: Integer;
begin
repeat
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
TempPos := pos('<img src="', Line);
if TempPos < 1 then
begin
StartPos := pos('<a href="', Line);
if StartPos > 0 then
begin
Startpos := Startpos + 9;
MovieAddress := copy(Line, StartPos, pos('" class=metin2>', Line) - StartPos);
StartPos := pos('<b>', Line) + 3;
MovieTitle := copy(Line, StartPos, pos('</b>', Line) - StartPos);
LineNr := LineNr + 1;
Line := Page.GetString(LineNr);
StartPos := pos('/ ', Line) + 2;
MovieTitle := MovieTitle + ' - ' + copy(Line, StartPos, pos ('<br>', Line) - StartPos);
HTMLDecode(Movietitle);
PickTreeAdd(MovieTitle, 'http://www.beyazperde.com/' + MovieAddress);
end;
end;
until pos('filmden', Line) > 0;
end;
begin
if CheckVersion(3,4,0) then
begin
MovieName := GetField(fieldOriginalTitle);
// if MovieName = '' then
// MovieName := GetField(fieldTranslatedTitle);
if Input('Turkish Title', 'Enter the original title of the movie:', MovieName) then
begin
AnalyzePage('http://www.beyazperde.com/hizliarama.asp?keyword='+UrlEncode(MovieName));
end;
end else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.0)');
end.
hmm...
i think there was a problem with the page. when some of the tags are not closed properly, you may encounter such problems. I come across these kind of problems in the description part of the movies the most, especially when <a> tag is not closed properly: </a (note the missing >)
I see <title> tag is improperly closed in what you get: </title
perhaps there was a temporary problem, and the page may not be completely downloaded.
does the problem still continue? (try searching for different movies..)
since the scripts depend on strict page structure, when the site changes the structure, scripts should also be changed. perhaps sites should provide some movie db files whose structures won't change?
anyway, let me check it again...
i think there was a problem with the page. when some of the tags are not closed properly, you may encounter such problems. I come across these kind of problems in the description part of the movies the most, especially when <a> tag is not closed properly: </a (note the missing >)
I see <title> tag is improperly closed in what you get: </title
perhaps there was a temporary problem, and the page may not be completely downloaded.
does the problem still continue? (try searching for different movies..)
since the scripts depend on strict page structure, when the site changes the structure, scripts should also be changed. perhaps sites should provide some movie db files whose structures won't change?
anyway, let me check it again...
Hi,
you may take a look at for the full script at:
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde.ifs
this should be working now. it works for me, at least.
by the way, ant, it's created by modifying your imdb script (since i had no idea how to write a script for amc ), so i think your name should be left there...
amc, good program, keep up the good work!
you may take a look at for the full script at:
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde.ifs
this should be working now. it works for me, at least.
by the way, ant, it's created by modifying your imdb script (since i had no idea how to write a script for amc ), so i think your name should be left there...
amc, good program, keep up the good work!
full list:
(with pic, full import)
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde%20(pic).ifs
(imports translated title only)
http://ada.cc.metu.edu.tr/amc/Beyaz%20P ... 0Only).ifs
(without pic, full import)
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde.ifs
(with pic, full import)
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde%20(pic).ifs
(imports translated title only)
http://ada.cc.metu.edu.tr/amc/Beyaz%20P ... 0Only).ifs
(without pic, full import)
http://ada.cc.metu.edu.tr/amc/Beyaz%20Perde.ifs