The script will analyze the page and add following fields.
Original Title, URL, Year, Rating, Comments (Ratings & Votes)
When done, I will export the this list and my movies catalog to CSV, open in Excel, and use VLookup & If functions to find if I have that movie or not.
I wish to keep Top 250 movies list as separate because
1. It keeps changing (although not so frequent)
2. I do not wish to update my entire movie catalog of 2500 films every month.
Problem:
To increase speed, I wish to copy page text to a local text file on HDD and access it instead of webpage each time.
Before running the script, the text file will already be saved as "C:\IMDBTop250.txt"
However I am getting an error and couldnt find more info on local text files on the forums. (or I am using wrong search terms)
Script till now:
Edit: To add more info.program IMDBTop250;
uses
StringUtils1;
var
PageText: string;
MovieNo: string;
MovieTitle: String;
MovieURL: String;
Value: string;
Temp1: string;
Temp2: string;
begin
PageText := GetPage('http://www.imdb.com/chart/top');
// PageText := GetPage('file:///C:/IMDBTop250.txt');
// PageText := GetPage('C:\IMDBTop250.txt');
MovieNo := getfield(fieldNumber);
Temp1 := '<td class="titleColumn">' + MovieNo + '. ' + '<a href="/title';
Temp2 := '</strong></td>';
Value := TextBetween(PageText, Temp1, Temp2);
SetField(fieldURL,'http://www.imdb.com/title/tt' + TextBetween(Value, '/tt', '/?ref_=chttp'));
SetField(fieldOriginalTitle, FullTrim(TextBefore(Value, '</a> <span class', '" >')));
SetField(fieldYear, textBetween(Value,'<span class="secondaryInfo">(',')</span></td>'));
SetField(fieldRating, textBetween(Value, 'votes">', '</strong></td>'));
SetField(fieldComments, textBetween(Value, '<td class="ratingColumn"><strong title="', '">'));
end.