Sample Screenshot for David Lynch info:
The script collects following information from http://www.allmovie.com/
Cast Name
Birth Date
Birth Place
Birth Year
Occupation (i.e. Director, Executive Producer, Screenwriter, Producer etc.)
Countries s/he worked
Main Genres of the Movies s/he played/directed
Names of the other Cast member s/he frequently worked
Detailed Biography
Filmography
Award and Nominations
Code (Copy text between the code tags and paste it into the notepad save file as with .ifs extension and then copy it into the Script folder in the Ant Movie Catalog)
Code: Select all
// GETINFO SCRIPTING
// All Movie Guide Actor&Director info import
(***************************************************
* Cast importation script for: *
* All Movie Guide (US), http://allmovie.com *
* version 0.1 *
* 02.10.2004 *
* *
***************************************************
* by KaraGarga *
* karagarga@gmail.com *
* *
* (based on 2003 Hubert Kosior's AMG Movie Script)*
***************************************************
* *
* For use with Ant Movie Catalog 3.4.1 *
* www.antp.be/software/moviecatalog *
* *
* This program is free software; you can *
* redistribute it and/or modify it under the *
* terms of the GNU General Public License as *
* published by the Free Software Foundation; *
* either version 2 of the License, or (at your *
* option) any later version. *
***************************************************)
program AllMovieCast;
var
MovieName: string;
// simple string procedures
function StringReplaceAll(S, Old, New: string): string;
begin
while Pos(Old, S) > 0 do
S := StringReplace(S, Old, New);
Result := S;
end;
procedure CutAfter(var Str: string; Pattern: string);
begin
Str := Copy(str, Pos(Pattern, Str) + Length(Pattern), Length(Str));
end;
procedure CutBefore(var Str: string; Pattern: string);
begin
Str := Copy(Str, Pos(Pattern, Str), Length(Str));
end;
// Loads and analyses page from internet (list of movies or direct hit)
procedure AnalyzePage(Address: string);
var
Page: TStringList;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
// movie list
if Pos('people with names like:', Page.Text) > 0 then
begin
PickTreeClear;
PickTreeAdd('All Movie Guide Name Search Results:', '');
AddMoviesTitles(Page);
if PickTreeExec(Address) then
AnalyzePage(Address);
// refine search
end
else
if Pos('Sorry, there is too many possible matches, please adjust your search.', Page.Text) > 0 then
begin
ShowMessage('Sorry, there is too many possible matches, please adjust your search.');
if Input('All Movie Import', 'Enter the title of the movie:', MovieName) then
AnalyzePage('http://allmovie.com/cg/avg.dll?p=avg&type=1&srch=' + URLEncode(MovieName));
// direct hit
end
else
begin
SetField(FieldURL, Address);
AnalyzeMoviePage(Page)
end;
end;
// Extracts movie details from page
procedure AnalyzeMoviePage(MoviePage: TStringList);
var
Page: string;
Value: string;
begin
Page := MoviePage.Text;
// Actor Name-------------------------------------------------------------------
Value := GetStringFromHTML(Page, '<TITLE>', ': ', '</TITLE>');
HTMLRemoveTags(Value);
SetField(fieldOriginalTitle, Value);
// Working Countries------------------------------------------------------------
Value := GetStringFromHTML(Page, 'Countries', '</TD>', '</td>');
HTMLRemoveTags(Value);
SetField(fieldCountry, Value);
// Occupation Description-------------------------------------------------------
Value := GetStringFromHTML(Page, 'Occupation', '</TD>', '</td>');
HTMLRemoveTags(Value);
SetField(fieldTranslatedTitle, Value);
// Birth date & Place ----------------------------------------------------------
Value := GetStringFromHTML(Page, 'Birth ', '</TD>', '</td>');
HTMLRemoveTags(Value);
Value := StringReplaceAll(Value, '-', '/');
SetField(fieldDirector, Value);
// Genres-----------------------------------------------------------------------
Value := GetStringFromHTML(Page, 'Genres', '</TD>', '</td>');
HTMLRemoveTags(Value);
SetField(fieldCategory, Value);
// Filmography------------------------------------------------------------------
Value := GetStringFromHTML(Page, '<A Name="FILMS">', '<FONT SIZE=-1>', '</TD></tr></Table>');
Value := StringReplaceAll(Value, ' aka', ' (aka ');
Value := StringReplaceAll(Value, '> ', '');
Value := StringReplaceAll(Value, '<TD width=314>', ' -- ');
Value := StringReplaceAll(Value, '<TD width=35 align=CENTER>', +#13#10+'(*)');
Value := StringReplaceAll(Value, '<TD width=130>', ' -- ');
HTMLRemoveTags(Value);
if Length(Value) > 0 then
SetField(fieldComments, 'A M G F I L M O G R A P H Y:'+#13#10+'(*)'+Value);
// Biography--------------------------------------------------------------------
Value := GetStringFromHTML(Page, '<A Name="BIO">', '</table>', '</table>');
HTMLRemoveTags(Value);
if Length(Value) > 0 then
SetField(fieldDescription, GetField(fieldDescription)+'A M G B I O G R A P H Y:'+#13#10+#13#10+Value);
// Awards-----------------------------------------------------------------------
Value := GetStringFromHTML(Page, '<A Name="AWARD">', '<TD class=botmargin WIDTH=200>', '</TABLE>');
Value := StringReplaceAll(Value, ' ', '');
Value := StringReplaceAll(Value, '<TD class=botmargin WIDTH=200>', +#13#10+'(*)');
Value := StringReplaceAll(Value, '<td WIDTH=209 class=botmargin>', ' -- ');
Value := StringReplaceAll(Value, '<TD Width=27 Align=CENTER class=botmargin>', ' (');
Value := StringReplaceAll(Value, '<td WIDTH=175 class=botmargin>', ') -- ');
HTMLRemoveTags(Value);
if Length(Value) > 0 then
SetField(fieldActors, GetField(fieldActors)+'AWARDS:'+#13#10+'(*)'+Value+#13#10+#13#10);
// Most Frequently Worked With...-----------------------------------------------
Value := GetStringFromHTML(Page, 'alt="Most Frequently Worked With"', '<B>', '</Table>');
Value := StringReplaceAll(Value, '</B> ', +#13#10);
Value := StringReplaceAll(Value, '<B>', #13#10);
Value := StringReplaceAll(Value, '</A>', ';');
HTMLRemoveTags(Value);
if Length(Value) > 0 then SetField(fieldActors, GetField(fieldActors)+'F R E Q U E N T L Y W O R K E D W I T H...'+#13#10+Value);
// remove trailing newline from description
Value := GetField(fieldDescription);
if Copy(Value, Length(Value) - 1, 2) = #13#10 then begin
Value := Copy(Value, 0, Length(Value) - 2);
SetField(fieldDescription, Value);
end;
DisplayResults;
end;
// Adds movie titles from search results to tree
procedure AddMoviesTitles(ResultsPage: TStringList);
var
Page: string;
MovieTitle, MovieAddress: string;
begin
Page := ResultsPage.Text;
// Every movie entry begins with string "<A HREF='/cg/avg.dll?"
while Pos('<A HREF="/cg/avg.dll?', Page) > 0 do
begin
CutBefore(Page, '<A HREF="/cg/avg.dll?');
MovieAddress := 'http://allmovie.com' + GetStringFromHTML(Page, '<A', '"', '">');
MovieTitle := GetStringFromHTML(Page, '<A', '', '</tr>');
MovieTitle := StringReplace(MovieTitle, '<font size=-1>', ' (');
MovieTitle := StringReplace(MovieTitle, '</font>', ')');
HTMLRemoveTags(MovieTitle);
CutAfter(Page, '</tr>');
// add movie to list
PickTreeAdd(MovieTitle, MovieAddress);
end;
end;
// Extracts single movie detail (like director, genre) from page
function GetStringFromHTML(Page, StartTag, CutTag, EndTag: string): string;
begin
Result := '';
// recognition tag - if present, extract detail from page, otherwise assume detail is not present
if Pos(StartTag, Page) > 0 then begin
CutBefore(Page, StartTag);
// optional cut tag helps finding right string in html page
if Length(CutTag) > 0 then
CutAfter(Page, CutTag);
// movie detail copied with html tags up to end string
Result := Copy(Page, 0, Pos(EndTag, Page) - 1);
// remove html tags and decode html string
HTMLDecode(Result);
// ShowMessage('DEBUG: GetStringFromHTML - StartTag "'+StartTag+'", CutTag "'+CutTag+'", EndTag "'+EndTag+'", Result "'+Result+'" ___ '+Page);
end;
end;
procedure RemovePronoun(var Str: string);
var
i: Integer;
s: string;
c: char;
begin
// remove pronouns
if (Copy(Str, 0, 2) = 'L ') or (Copy(Str, 0, 2) = 'A ') then
Str := Copy(Str, 3, Length(Str) - 2)
else if (Copy(Str, 0, 3) = 'Le ') or (Copy(Str, 0, 3) = 'La ') or (Copy(Str, 0, 3) = 'Un ') then
Str := Copy(Str, 4, Length(Str) - 3)
else if (Copy(Str, 0, 4) = 'Les ') or (Copy(Str, 0, 4) = 'Une ') or (Copy(Str, 0, 4) = 'The ') then
Str := Copy(Str, 5, Length(Str) - 4);
// remove non-letters, non-digits and non-spaces
s := '';
for i := 1 to Length(Str) do begin
c := StrGet(Str, i);
if ((c<'a') or (c>'z')) and
((c<'A') or (c>'Z')) and
((c<'0') or (c>'9')) and
(c<>' ') then
else
s := s + Copy(Str, i, 1);
end;
Str := s;
end;
begin
if CheckVersion(3,4,1) then begin
MovieName := GetField(fieldOriginalTitle);
if MovieName = '' then MovieName := GetField(fieldTranslatedTitle);
RemovePronoun(MovieName);
if Input('All Movie Guide Name Import', 'Enter the name of the actor:', MovieName) then
AnalyzePage('http://allmovie.com/cg/avg.dll?p=avg&type=1&srch=' + URLEncode(MovieName)+'~C');
end else ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.4.1)');
end.
and the Language file for only this script.
Download here
Unzip lang file and pu it into "Languages" folder.