(*************************************************** Ant Movie Catalog importation script www.antp.be/software/moviecatalog/ [Infos] Authors=IkE Blaster; původní skript - Trottel Title=Sosátko.cz - DVD Obaly Description=Importuje obaly přes web kfilmu.net Site=http://www.sosatko.cz/ Language=CZ Version=1.0 Requires=3.5.0 Comments= License=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. GetInfo=1 [Options] ***************************************************) program kfilmu_net; const BaseAdress = 'http://www.sosatko.cz/dvd_obaly/'; 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; function iPos (Substr: String; S: String): Integer; begin Substr := AnsiLowerCase(Substr); S := AnsiLowerCase(S); Result := Pos(Substr, S); end; function FormatText(T: String): String; var BeginPos: Integer; begin BeginPos := iPos(' ', T); while (BeginPos > 0 ) do begin Delete(T, BeginPos, 1); BeginPos := iPos(' ', T); end; T := StringReplace(T, #13#10, ''); T := StringReplace(T, '

', #13#10#13#10); T := StringReplace(T, '

', #13#10#13#10); T := StringReplace(T, '
', #13#10); T := StringReplace(T, '
', #13#10); Result := T; end; // ***** Analyzuje stranku s vysledky hledani ***** procedure AnalyzeResultPage(Address: String); var Line, iLine, aLine, uLine, MovieTitle, MovieAddress, Value: string; BeginPos, EndPos: Integer; begin Line := GetPage(Address); PickTreeClear; PickTreeAdd('Nalezené filmy:', ''); BeginPos := iPos('', iLine); MovieTitle := Trim(Copy(iLine, BeginPos+6, Length(iLine))); PickTreeAdd(MovieTitle, MovieAddress); BeginPos := iPos(' 0 then begin Line := Page.GetString(LineNr); BeginPos := pos('/dvdcovers/', Line); EndPos := pos('" width="', Line); Value := copy(Line, BeginPos, EndPos - BeginPos); GetPicture('http://www.sosatko.cz/' + Value); end; end; // Spusteni vlastniho programu begin //kontrola jestli je verze programu vyssi nez 3.5.0 if CheckVersion(3,5,0) then begin //vem prelozene jmeno filmu MovieName := GetField(fieldTranslatedTitle); //pokud je prelozene jmeno prazdne if MovieName = '' then //vem originalni jmeno MovieName := GetField(fieldOriginalTitle); //zadavani nazvu hledaneho filmu if Input('Import dat z sosatko.cz', 'Zadej název hledaného filmu:', MovieName) then begin //analyzuj stranku http://film.kfilmu.net/uzivatele.php?......=premiery&co=jmeno_filmu AnalyzeResultPage(BaseAdress+'search/strana_1.htm?search=' + UrlEncode(MovieName)); end; end else ShowMessage('Tento skript vyžaduje novější verzi programu Ant Movie Catalog (nejméně verzi 3.5.0)'); end.