Scripts that need to be fixed / Scripts à corriger
-
- Posts: 2
- Joined: 2007-04-13 18:44:39
- Location: Genk - Belgium
-
- Posts: 2
- Joined: 2007-04-13 18:44:39
- Location: Genk - Belgium
-
- Posts: 14
- Joined: 2007-04-14 18:25:03
@antp: Sorry for replacing your name with mine... It was my first attempt to modify a script and did not expect it to work or even release it...
But once it did work, I forgot to adjust the properties again...
I corrected my mistake, cleaned up the source a bit and uploaded the new file.
Anyway, I love your Movie Catalog program.
But once it did work, I forgot to adjust the properties again...
I corrected my mistake, cleaned up the source a bit and uploaded the new file.
Anyway, I love your Movie Catalog program.
-
- Posts: 14
- Joined: 2007-04-14 18:25:03
-
- Posts: 14
- Joined: 2007-04-14 18:25:03
Maybe this will help?vlada_sk8 wrote:Something is wrong with moviegoods.com script! i thing that search line was change!! Cheers
Code: Select all
program MOVIEGOODS;
var
MovieName: string;
MovieURL: string;
ImageURL: string;
ImageName: string;
// STRING PROCEDURES (don't delete any part of this)
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;
// GetStringFromHTML funtion
function GetStringFromHTML(Page, StartTag, CutTag, EndTag: string): string;
begin
Result := '';
if Pos(StartTag, Page) > 0 then begin
CutBefore(Page, StartTag);
if Length(CutTag) > 0 then
CutAfter(Page, CutTag);
Result := Copy(Page, 0, Pos(EndTag, Page) - 1);
HTMLDecode(Result);
end;
end;
// END OF STRING PROCEDURES
// Anaylze main title
procedure AnalyzePage(Address: string);
var
Page: TStringList;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
if pos('<table width="100%" height="100%">', Page.Text) = 0 then
begin
ShowMessage('Sorry no cover available!');
end else
begin
PickTreeClear;
PickTreeAdd('Search results', '');
AddMoviesTitles(Page);
if PickTreeExec(Address) then
AnalyzePage2(Address);
end;
Page.Free;
end;
// Analyze exist posters for the main title
procedure AnalyzePage2(Address: string);
var
Page: TStringList;
URL: string;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
PickTreeClear;
PickTreeAdd('Available Poster Types', '');
AddMoviesTitles2(Page);
if PickTreeExec(Address) then
GetPicture (Address);
Page.Free;
end;
// Add the name of the searched movies
procedure AddMoviesTitles(ResultsPage: TStringList);
var
Page: string;
MovieTitle, MovieAddress: string;
begin
Page := ResultsPage.Text;
while Pos('<table width="100%" height="100%">', Page) > 0 do
begin
CutBefore(Page, '<table width="100%" height="100%">');
MovieAddress := GetStringFromHTML(Page, 'a href="', 'href="', '"');
MovieTitle := GetStringFromHTML(Page, '<b>', '', '</b>');
ImageURL:= 'http://www.moviegoods.com/Assets/product_images/1000/'+GetStringFromHTML(Page, 'width="120"><img src="', 'src="', '"');
CutAfter(Page, '</a>');
MovieAddress := StringReplace(MovieAddress, '1000.A', '1020.A');
HTMLRemoveTags(MovieTitle);
PickTreeAdd(MovieTitle, MovieAddress+ImageURL);
end;
end;
// add the poster names for the searched title
procedure AddMoviesTitles2(ResultsPage: TStringList);
var
Page: string;
MovieTitle, MovieAddress: string;
begin
Page := ResultsPage.Text;
while Pos('<INPUT TYPE="HIDDEN" NAME="DSP_IMAGE" VALUE="', Page) > 0 do
begin
CutBefore(Page, '<INPUT TYPE="HIDDEN" NAME="DSP_IMAGE" VALUE="');
MovieAddress := 'http://www.moviegoods.com/Assets/product_images/1000/'+GetStringFromHTML(Page, '<INPUT TYPE="HIDDEN" NAME="DSP_IMAGE" VALUE="', 'UE="', '">');
MovieTitle := GetStringFromHTML(Page, 'border=2 ALT=', '"', '></A>');
MovieAddress := StringReplace(MovieAddress, '1000.A', '1020.A');
CutAfter(Page, '">');
HTMLRemoveTags(MovieTitle);
PickTreeAdd(MovieTitle, MovieAddress);
end;
end;
begin
if CheckVersion(3,5,0) then
begin
MovieName := GetField(fieldOriginalTitle);
if MovieName = '' then
MovieName := GetField(fieldTranslatedTitle);
if Input('MovieGoods Poster Import 0.3', 'Please enter English title:', MovieName) then
begin
AnalyzePage('http://search.moviegoods.com/search?w='+UrlEncode(MovieName)+'&Go2.x=0&Go2.y=0');
end;
end
else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');
end.
1) IMDB script is not working anymore It simply returns "http://www.imdb.com/title/tt"
Can smb help with this issue?
2) ImpAwards script does not work as it should be - sometimes it finds the movie, but sometimes not (when the movie poster is actually in their database). I also failed to find an update for this script under author's script directory. Am I blind to see it, or is it actually not supported anymore?
Thanks,
Can smb help with this issue?
2) ImpAwards script does not work as it should be - sometimes it finds the movie, but sometimes not (when the movie poster is actually in their database). I also failed to find an update for this script under author's script directory. Am I blind to see it, or is it actually not supported anymore?
Thanks,
1. For me the latest version of the IMDB script ( www.antp.be/temp/scripts ) seems to work. If it fails with that one, try to disable your firewall just to test, to see if it is its fault. Else give the title of the movie that causes that problem.
2. That script was last updated two years ago, so maybe the site changed. Someone would have to update it if it does not work correctly.
2. That script was last updated two years ago, so maybe the site changed. Someone would have to update it if it does not work correctly.
1) sorry, my mistake. my proxy was playing tricks with me
2) yes, there certainly are problems with Impawards script. I am no programmer though.. Can smb pls fix this for me or at least tell me where to look and how to do this? This is really my #1 choice for film posters. They have high quality, lots of choice for most of them..
P.S. antp, thanks for the program, it's really great, I've been using it for couple of years now and entered quite a decent number of films. really useful to take a look back and see what was what. thx
2) yes, there certainly are problems with Impawards script. I am no programmer though.. Can smb pls fix this for me or at least tell me where to look and how to do this? This is really my #1 choice for film posters. They have high quality, lots of choice for most of them..
P.S. antp, thanks for the program, it's really great, I've been using it for couple of years now and entered quite a decent number of films. really useful to take a look back and see what was what. thx
At first a big THX to the creators of this stuff!antp wrote:1. For me the latest version of the IMDB script ( www.antp.be/temp/scripts ) seems to work.
I used Colectorz.com a while but after some issues with script I gave Ant a try and decided that it was perfect for the job.
Off topic: I liked the layout of Colectorz a bit more, (the picture within the film properties) but at least Ant is working all the time..
About IMDB I had no problems after creating the script today, the 2th of may 2007, but I search for the link that IMDB give for a movie.
So I go to their website and search, after the movie is found I copy the URL into scenario and the film is correctly added to Ant.
Its a workaround but I don't have hundreds of movies to add every day, so it will do for me...
MovieMeter (NL) fixed. I changed two lines within the script :
to
and
to
Maybe you can find a more elegant solution for the second workaround, but you should know that Line := TextBetween(Page.Text, 'class="filmresults_row1 first" >', '<form action="http://www.moviemeter.nl/film/search/"'); will not work with all films!
Download : http://bad4u.saveitfree.com/scripts/Mov ... 8NL%29.ifs
@Antoine: Just want to mention that I set version number from 2.6.1. to 2.6.2 . If you don't like it, you can use it as basis for your own corrections. If you like it, upload it
Code: Select all
AnalyzeResultsPage('http://www.moviemeter.nl/?search&q='+UrlEncode(MovieName));
Code: Select all
AnalyzeResultsPage('http://www.moviemeter.nl/film/search/'+UrlEncode(MovieName));
Code: Select all
Line := TextBetween(Page.Text, 'class="filmresults_row1">', '<form action="http://www.moviemeter.nl/film/search/"');
Code: Select all
if Pos('Zoekresultaten in films:', Page.Text) > 0 then
Line := TextBetween(Page.Text, 'Zoekresultaten in films:</p>', '<form action="http://www.moviemeter.nl/film/search/"');
if Pos('Alle zoekresultaten in films:', Page.Text) > 0 then
Line := TextBetween(Page.Text, 'Alle zoekresultaten in films:</p>', '<form action="http://www.moviemeter.nl/film/search/"');
Line := TextBetween(Line, '</p></div>', '<p><br /></p>');
Download : http://bad4u.saveitfree.com/scripts/Mov ... 8NL%29.ifs
@Antoine: Just want to mention that I set version number from 2.6.1. to 2.6.2 . If you don't like it, you can use it as basis for your own corrections. If you like it, upload it