Script for FILMSTARTS.de
Posted: 2008-02-18 19:35:51
Hi,
I wrote a small script for the german site FILMSTARTS.de.
It´s a kind of "on top" to the imdb-script, but it can be used seperately as well.
Why on-top?
Because imdb provides you with a lot of good information and much more movies.
The intention for this script was the use of the better picture and the much better description/comment (of course in german) at FILMSTARTS.de.
So, what does the script do?
1) It puts the original title to translated title and the german to original.
- I like to have the german title on the movie list.
2) Provides you with a bigger picture in better resolution
3) Puts the movie description/comment to the comments field
The script works, as far as i could test it, with the english or german title.
You only need to type in the english title, start the IMDB script as usual, then start the Filmstarts.de-script.
Have fun.
I wrote a small script for the german site FILMSTARTS.de.
It´s a kind of "on top" to the imdb-script, but it can be used seperately as well.
Why on-top?
Because imdb provides you with a lot of good information and much more movies.
The intention for this script was the use of the better picture and the much better description/comment (of course in german) at FILMSTARTS.de.
So, what does the script do?
1) It puts the original title to translated title and the german to original.
- I like to have the german title on the movie list.
2) Provides you with a bigger picture in better resolution
3) Puts the movie description/comment to the comments field
The script works, as far as i could test it, with the english or german title.
You only need to type in the english title, start the IMDB script as usual, then start the Filmstarts.de-script.
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=J
Title=Filmstarts.de
Description=Filmstarts.de
Site=ww.filmstarts.de
Language=DE
Version=1.0.0 - 18/02/2008
Requires=3.5.0
Comments=
License=IMPORTANT NOTICE:||THIS SCRIPT IS FOR PERSONAL USE ONLY ! |DO NOT REDISTRIBUTE ANY DATA WITHOUT THE PERMISSION OF THE COPYRIGHT OWNER ! RESPECT COPYRIGHTS !||The script itself 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. |
GetInfo=1
[Options]
***************************************************)
// FILMSTARTS.de - Script Version 1.0.0 (20080218/J)
//
// v.1.0.0 - 18/02/2008 - first public release
program FILMSTARTS;
uses
StringUtils1;
var
MovieName, Value: string;
procedure AnalyzePage(Address: string);
var
Page: TStringList;
RealAddress, TextEnd: string;
begin
Page := TStringList.Create;
// Get real URL with number found in search
begin
Page.Text := GetPage(Address);
Value := TextBetween(Page.Text, 'http://www.filmstarts.de/produkt/', '.html');
RealAddress := 'http://www.filmstarts.de/produkt/' + Value + '.html';
Page.Text := GetPage(RealAddress);
end;
// Get german title --> original title field
Value := '';
begin
Value := TextBetween(Page.Text, '<h1 class="title">', '<span class="genre">');
If Value <> '' then
begin
MovieName := GetField(fieldOriginalTitle);
setField (fieldTranslatedTitle, MovieName);
setField (fieldOriginalTitle, Value);
end;
end;
// Get big Cover //
Value := '';
begin
Value := TextBetween(Page.Text, 'http://thumbs.filmstarts.de/menu/', '"');
If Value <> '' then
begin
Value := 'http://thumbs.filmstarts.de/wallpaper/' + Value;
GetPicture(Value);
end;
end;
// Get Movie Description/Comments --> comments field
Value := '';
begin
// If there´s no review then get preview
If Pos('<div class="right bold paddingBottom">', Page.Text) > 0 then
TextEnd := '<div class="right bold paddingBottom">'
else
TextEnd := '<div class="paddingBox right" style="clear:both">';
Value := TextBetween(Page.Text, '<div class="paddingBigBox" align="justify">', TextEnd);
// *** Delete HTML-stuff for raw-Text --- start ***
// Delete starting Tabs
Delete (Value, 1, 11);
// Delete Info Popup
while Pos('<a class', Value) > 0 do
Delete (Value, Pos('<a class', Value), Length(TextBetween(Value, '<a class', 'title\')) + 16);
while Pos('</div', Value) > 0 do
Delete (Value, Pos('</div', Value), Length(TextBetween(Value, '</div', '/a')) + 8);
// Delete Tables & Pictures
while Pos('<table', Value) > 0 do
Delete (Value, Pos('<table', Value), Length(TextBetween(Value, '<table', '/table')) + 13);
// Delete <...>
while Pos('<', Value) > 0 do
Delete (Value, Pos('<', Value), Length(TextBetween(Value, '<', '>')) + 2);
// Delete ending Tabs
Delete (Value, Length(Value) - 10, 10);
// *** Delete HTML-stuff for raw-Text --- end ***
setField(fieldComments, Value);
Value := '';
end;
end;
begin
if AcceptLicense(1) = False then
Exit;
if CheckVersion(3,5,0) then
begin
MovieName := GetField(fieldOriginalTitle);
if MovieName = '' then
MovieName := GetField(fieldTranslatedTitle);
if Input('Filmstarts.de Import', 'Enter the title of the movie:', MovieName) then
begin
// FILMSTARTS.de handles apostrophes with different & changing characters in search function and title-URL,
// but works mostly with auto-cutting apostrophe and rest of word. (e.g. I´ve --> I).
// -- If that wouldn´t work, type in title without apo-word (e.g. "not there" instead of "i´m not there")
MovieName := StringReplace (MovieName, #39, '´');
if Pos('´', MovieName) > 0 then
Delete (MovieName, Pos('´', MovieName), Length(TextBetween(Moviename, '´', ' ')) + 1);
// Use FILMSTARTS.de internal search function to get working title-URL
AnalyzePage('http://www.filmstarts.de/suche.html?anfrage='+UrlEncode(MovieName));
end;
end
else
ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');
end.
Have fun.