(*************************************************** Ant Movie Catalog importation script www.antp.be/software/moviecatalog/ [Infos] Authors=n'alf (nalf75014@yahoo.fr) Title=tv.com Description=TV series import from tv.com Site=http://www.tv.com Language=EN Version=0.5 beta (30/09/2005) Requires=3.5.0 Comments=inspired by the tvtome script by Alex Iribarren 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 TvCom; var EpName, EpNumber, SeName: string; 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 AnalyzeEpListing(Address: string); var Page: TStringList; LineNr, StartPos, EndLine, Res: Integer; Line, Season, EpTitle, EpNr, found: string; begin Page := TStringList.Create; Address := Address + 'episode_listings.html'; Page.Text := PostPage(Address, URLEncode('season=0')); LineNr := FindLine('Click here to continue to TV.com', Page, 0); if LineNr > -1 then begin Line := Page.GetString(LineNr); AnalyzeResults(SeName); Exit; end PickTreeClear; PickTreeAdd('Results for "' + EpName + '"', ''); LineNr := FindLine('', Page, LineNr); Address := ''; Res := 0; EndLine := FindLine('', Page, 0); repeat LineNr := FindLine('