Personal Video Database
English => Development => Topic started by: pra15 on November 24, 2011, 09:26:41 am
-
Hello!
First sorry for my english (i'm french)!
I tried to make a script to download data from egafd.com, adapted to the iafd script.
Script :
//This version of script is for use with PVD versions 0.9.9.16 and above!!!
(*
Additional types and functions that can be used in scripts:
//Types
TWIDEARRAY : array of String
//Field functions
procedure AddSearchResult(Title1, Title2, Year, URL, PreviewURL : String)
procedure AddFieldValue(AField: Integer; AValue : String)
procedure AddMoviePerson(Name, TransName, Role, URL : String; AType : Byte)
procedure AddPersonMovie(Title, OrigTitle, Role, Year, URL : String; AType : Byte)
procedure AddAward(Event, Award, Category, Recipient, Year: String; const Won : Boolean)
procedure AddConnection(Title, OrigTitle, Category, URL, Year: String)
procedure AddEpisode(Title, OrigTitle, Description, URL, Year, Season, Episode : String)
//String functions
function Pos(Substr : String; Str: String): Integer
function PosFrom(const SubStr, Str : String; FromIndex : Integer) : Integer
function LastPos(const SubStr, Str : String) : Integer
function PrevPos(const SubStr, Str : String; APos : Integer) : Integer
function RemoveTags(AText : String; doLineBreaks : Boolean) : String
function ExplodeString(AText : String; var Items : TWideArray; Delimiters : String) : Integer
function Copy(S: String; Index, Count: Integer): String
procedure Delete(var S: String; Index, Count: Integer)
procedure Insert(Source: String; var Dest: String; Index: Integer)
function Length(S: String): Integer
function Trim(S: String): String
function CompareText(S1, S2: String): Integer
function CompareStr(S1, S2: String): Integer
function UpperCase(S: String): String
function LowerCase(S: String): String
function StringReplace(S, OldPattern, NewPattern: String; ReplaceAll : Boolean; IgnoreCase : Boolean; WholeWord: Boolean): String
function StrToInt(const S: String): Integer
function IntToStr(const Value: Integer): String
function StrToFloat(const S: String): Extended
function FloatToStr(const Value: Extended): String
function HTMLValues(const HTML : String; ABegin, AEnd, ItemBegin, ItemEnd : String; ValDelim : String; var Pos : Integer) : String
function HTMLValues2(const HTML : String; ABegin, AEnd, ItemBegin, ItemEnd : String; ValDelim : String; var Pos : Integer) : String
function TextBetween(const HTML : String; ABegin, AEnd : String; doLineBreaks : Boolean; var Pos : Integer) : String
function HTMLToText(const HTML : String) : String
procedure ShowMessage(const Msg, Head : String)
*)
const
pauseBeforeLoad = 1000; // Pause before loading (in millisecond)
//Some useful constants
const
//Script types
stMovies = 0;
stPeople = 1;
stPoster = 2;
//Script modes
smSearch = 0;
smNormal = 1;
smPoster = 2;
//Parse results
prError = 0;
prFinished = 1;
prList = 2;
prListImage = 3;
prDownload = 4;
//Movie fields
mfURL = 0;
mfTitle = 1;
mfOrigTitle = 2;
mfAka = 3;
mfYear = 4;
mfGenre = 5;
mfCategory = 6;
mfCountry = 7;
mfStudio = 8;
mfMPAA = 9;
mfRating = 10;
mfTags = 11;
mfTagline = 12;
mfDescription = 13;
mfDuration = 14;
mfFeatures = 15;
//People fields
pfURL = 0;
pfName = 1;
pfTransName = 2;
pfAltNames = 3;
pfBirthday = 4;
pfBirthplace = 5;
pfGenre = 6;
pfBio = 7;
pfDeathDate = 8;
//Credits types
ctActors = 0;
ctDirectors = 1;
ctWriters = 2;
ctComposers = 3;
ctProducers = 4;
//Script data
//This version of script is for use with PVD versions 0.9.9.16 and above!!!
SCRIPT_VERSION = '0.0.0.1';
SCRIPT_NAME = 'EGAFD.com';
SCRIPT_DESC = '[EN] Get movie information from EGAFD.com';
SCRIPT_LANG = $09; //English
SCRIPT_TYPE = stMovies;
BASE_URL = 'http://www.egafd.com';
RATING_NAME = 'ADE';
SEARCH_STR = 'www.egafd.com/results.asp?SearchType=Mozilla-search&SearchString=%s';
CODE_PAGE = 0; //Use 0 for Autodetect
//Global variables
var
Mode : Byte;
PosterURL : String;
//Functions
function GetScriptVersion : String;
begin
Result := SCRIPT_VERSION;
end;
function GetScriptName : String;
begin
Result := SCRIPT_NAME;
end;
function GetScriptDesc : String;
begin
Result := SCRIPT_DESC;
end;
function GetRatingName : String;
begin
Result := RATING_NAME;
end;
function GetScriptLang: Cardinal;
begin
Result := SCRIPT_LANG;
end;
function GetCodePage : Cardinal;
begin
Result := CODE_PAGE;
end;
function GetBaseURL : AnsiString;
begin
Result := BASE_URL;
end;
function GetDownloadURL : AnsiString;
begin
if PosterURL = '' then
Result := SEARCH_STR
else
Result := PosterURL;
end;
function GetScriptType : Byte;
begin
Result := SCRIPT_TYPE;
end;
function GetCurrentMode : Byte;
begin
Result := Mode;
end;
procedure FindPoster(HTML : String);
var
curPos, EndPos : Integer;
begin
LogMessage('procedure Findposter en cours')
// curPos := Pos('<span class="Item_ViewTitle">Box Cover</span>', HTML);
// curPos := PosFrom('<img src="', HTML, curPos);
// curPos := curPos + Length('<img src="');
// EndPos := PosFrom('"', HTML, curPos);
// PosterURL := Copy(HTML, curPos, EndPos - curPos);
end;
// ParseMovie
// - after searchlist selection this function is called with the new html content
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, EndPos, P, P2, L: Integer;
actPosStart,actPosStart2,
actPosEnd, UrlPosStart,UrlPosEnd,debug_pos1:Integer;
Tmp, URL, Name,dbgstrg,tmpstrg : String;
ActorNames: TWideArray;
ActorNumber,I,J: Integer;
begin
AddFieldValue(mfURL, MovieURL);
LogMessage('Page parsing started');
EndPos := 1;
//Check for title. No orig. title info present, so duplicate..
dbgstrg:= TextBetween(HTML, '<title>', '</title>', False, EndPos);
LogMessage('Title: ' + dbgstrg);
AddFieldValue(mfOrigTitle,dbgstrg);
AddFieldValue(mfTitle,dbgstrg);
//Year
dbgstrg := '';
CurPos := Pos('Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
AddFieldValue(mfYear,dbgstrg);
//Director
curPos := Pos('Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
//Notes
curpos := Pos('Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
AddFieldValue(mfDescription, dbgstrg);
//AKA - Titles...
LogMessage('getting all titles')
Curpos := Pos('<th>Alternate Titles</th>' ,HTML);
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('<th>Actresses</th>', HTML, EndPos)) do begin
EndPos := curPos;
actPosStart := PosFrom('class="flma"', HTML, EndPos);
actPosEnd := PosFrom('</span>', HTML, actPosStart);
dbgstrg := Trim(Copy(HTML, (actPosstart + 13), (actPosEnd - actPosStart - 13) ));
LogMessage('AKA: ' + dbgstrg);
AddFieldValue(mfAka, dbgstrg);
curpos := PosFrom('class="flma"', HTML, actPosEnd);
end;
//Cast
curPos:= Pos('<th>Actresses</th>', HTML);
LogMessage('Cast readout');
if curPos > 0 then begin
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('<th>Notes</th>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('>', HTML, UrlPosStart); // search for url end
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart + 6, (UrlPosEnd - UrlPosStart - 7) ));
LogMessage(URL);
// Get Name
actPosStart := PosFrom('href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
AddMoviePerson(Trim(Name), '', '', LowerCase(URL), ctActors);
curPos := PosFrom('href="', HTML, actPosEnd);
end;
end;
end; // End of the routine...
// ParseSearchResults
// - create list of movies found during the search
procedure ParseSearchResults(HTML : String);
var
curPos, EndPos, P : Integer;
Title, Year, URL, Studio : String;
begin
LogMessage('procedure ParseSearchResults en cours')
EndPos := 1;
LogMessage('Parsing movie list...');
curPos := PosFrom('<dt>', HTML, EndPos);
while curPos > 0 do
begin
// Each movie entry starts with <dt>
EndPos := curPos + Length('<dt>');
curPos := PosFrom('<a href="', HTML, EndPos);
if curPos > 0 then begin
curPos := curPos + Length('<a href="');
EndPos := PosFrom('"', HTML, curPos);
URL := BASE_URL + '/' + Copy(HTML, curPos, EndPos - curPos);
LogMessage('URL detected: '+URL);
end;
Title := TextBetween(HTML, '>', '</a>', False, EndPos);
LogMessage(Title);
// Now that we got the title, move on to the studio...
curPos := PosFrom('<b>Release Info:</b>', HTML, EndPos);
if curPos > 0 then begin
curPos := curPos + Length('<b>Release Info:</b>') + 1;
EndPos := PosFrom(',', HTML, curPos);
Studio := Copy(HTML, curPos, EndPos - curPos);
LogMessage(Studio);
curPos := EndPos + 2;
EndPos := PosFrom('<', HTML, curPos);
Year := Copy(HTML, curPos, EndPos - curPos);
LogMessage(Year);
end;
AddSearchResult(Title, Studio, Year, URL, '');
curPos := PosFrom('<dt>', HTML, EndPos);
end;
end;
// ParsePage
// - Entrypoint for the script. Check if the search-term leads to zero, one or many results.
function ParsePage(HTML : String; URL : AnsiString) : Cardinal;
begin
Wait (pauseBeforeLoad);
LogMessage('Script version:' + SCRIPT_VERSION);
Mode := smNormal;
ParseMovie(URL, HTML);
Result := prFinished; //script has finished it's job
{Result := prError; //error (unknown page retrieved)}
end;
begin
Mode := smSearch;
end.
For use this script, the URL of the page must be indicate in the data movie before execute.
The data transfered are good in my PC!
My problem is to write "notes" in field comment and not in field description!
I tried to declare "mfComment = 16;" but no data are transfered!
If somebody is interested, or can improve it!
Thanks a lot!
-
Welcome, pra15
My problem is to write "notes" in field comment and not in field description!
I tried to declare "mfComment = 16;" but no data are transfered!
As the first "mfComment" not yet exist and does not work yet.
It is a solution ot the PVD settings looking at the attached picture. Now the information in the comment box.
Since the author did not do psf files, egafd.psf is now attached in this reply.
[attachment deleted by admin]
-
Thanks a lot !
I try now with egafd_people, but my script doesn't work!
When i look the log, the values are good but no data are tranfered to my PC !
[attachment deleted by admin]
-
I try now with egafd_people, but my script doesn't work!
With pre-made duplicate url script works, but info does not transfer data.
Sorry, but unfortunately you can not help.
It might be good to have a review of the movie scripts and try to maybe do a similar script as the AllMovie script or Rovi script or on the basis of these scripts to make changes, that the script is ready to transfer data from http://www.egafd.com .
-
Ok this script works for me,
I simplified it in maximum.
After have taken info about a movie with script egafd.psf, you have URL and name for actresse in egafd.
Now you can use this script egafd_people.psf for download photo and pseudonyms.
Is it possible to insert a link (to web page) in the field Biographie?
I try <Link="www......">Name</Link> but when i click in, nothing happens!
[attachment deleted by admin]
-
For egafd.psf
//Notes
curpos := Pos('Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
AddFieldValue(mfDescription, dbgstrg);
Proposal:
AddFieldValue(mfDescription, dbgstrg);
Replace this
AddFieldValue(mfTagline, dbgstrg);
You can add yet Notes: (Description) in a similar manner as in people added pfBio
-------------------------------------------------------------------
Here you is an updated egafd_people.psf
Is now added pfbio (films).
Script is attached.
[attachment deleted by admin]
-
Hello,
Thank you, great.
I wanted make this, but it's for the reason of my last question.
Is it possible to incorporate the link (clickable) of the movie (from egafd and not link title of the database) in the list of movie?
-
I try <Link="www......">Name</Link> but when i click in, nothing happens!
<Link="www......">Name</Link>
This is wrong (not correct), so can not work.
Try something like the following
'<link url="' + PeopleURL + '">' + Name + '</link>'
or is this
'<link url="' + MovieURL + '">' + Title + '</link>'
or something similar as previously described.
Or, do like code as the code in egafd.psf for Cast.
I apologize if I did not understand everything correctly on this issue, but I hope that the answer was still helpful.
-
procedure ParseCast(HTML : String);
var
curPos, endPos : Integer;
TmpStr : String;
Name, Role, URL : String;
begin
curPos := Pos('<div class="tabset-content main-tab-pane">', HTML);
if curPos < 1 then
curPos := Pos('<div class="description-box">', HTML);
if curPos < 1 then
Exit;
TmpStr := '';
endPos := curPos;
curPos := PosFrom('http://www.allrovi.com/name/', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</table>', HTML, endPos)) do begin
endPos := PosFrom('">', HTML, curPos);
URL := Copy(HTML, curPos, endPos - curPos);
curPos := endPos + 2;
endPos := PosFrom('</a>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
curPos := PosFrom('>', HTML, endPos);
if curPos > 0 then begin
curPos := curPos + 2;
endPos := PosFrom('</td', HTML, curPos);
Role := Copy(Trim(Copy(HTML, curPos + 4, endPos - curPos - 4)), 5, endPos - curPos - 4);
end else begin
Role := '';
curPos := endPos;
end;
if GET_ACTORS then
AddMoviePerson(Name, '', '', URL, ctActors);
if TmpStr <> '' then
TmpStr := TmpStr + #13;
if URL <> '' then
TmpStr := TmpStr + '<link url="' + URL + '">';
TmpStr := TmpStr + Name;
if Role <> '' then
TmpStr := TmpStr + ' • ' + Role;
if URL <> '' then
TmpStr := TmpStr + '</link>';
if curPos > 0 then
curPos := PosFrom('http://www.allrovi.com/name/', HTML, curPos)
else
Exit;
end;
AddCustomFieldValueByName('Cast', TmpStr);
Perhaps you will keep this code something to help, how to integrate TmpStr and then how to continue, is copy that URL, that you want to copy in the database.
-
Ok, thanks,
manually, <link url= works good, i will try to incorporate this in the script later.
I'm trying to add function of search within the url at start.
-
>:(
Hello,
I'm blocked !!!!!
I search to obtain the value of the URL start.
I tried with : getfieldvalue(pfurl) but this give me a number and not a url !!!! ???
Sorry i'm not a developer!
-
Sorry i'm not a developer!
Me neither.
Attempts to examine Rovi script (http://www.videodb.info/download.php?ftype=1&file=AllRovi.zip) or AllMovie script (http://www.videodb.info/download.php?ftype=1&file=allmovie.zip), if you will do any good.
egafd_mod.psf is attached
[attachment deleted by admin]
-
I'm blocked !!!!!
I search to obtain the value of the URL start.
I tried with : getfieldvalue(pfurl) but this give me a number and not a url !!!!
You can add this code in a reply if you still have this code and add the entire script to the end of the reply that I can see the result (number, not URL), and how or what can help you (if you can, of course) about this problem.
-
Is it possible to insert a link (to web page) in the field Biographie?
I try <Link="www......">Name</Link> but when i click in, nothing happens!
I managed, so you'll be happy.
egafd_people_mod.psf is attached
[attachment deleted by admin]
-
Thanks a lot!
I'm fighting with the search Function since two days!
HHHHHHAAAAAAAA!
I can find the URL, if the name or pseudo is strictly the same, but if it's only a part of the real name ........
egafd have pages with alphabetics letters.
-
egafd have pages with alphabetics letters.
This is really a very big problem to find the url for SEARCH_STR , the best is still to what is mentioned in these words:
For use this script, the URL of the page must be indicate in the data movie before execute.
-
I post my new egafd (on the way, so confuse), i don't use SEARCH_STR but go to the alphabetic page of the name.
If Title is the exact name or exact Pseudo the script give the good info, but if it's the pseudo you must choose the good line:
Title alias for Real Name.
I have added your code for Movie link, but i have a problem in part //get year.
All the line are not the same if the movie is original, alternate title or best of, so we can't step to "class=notes" for all.
I want step first to "</a>", then step to ">" for obtain info (but here, it seems to stay in the ">" of the "a>").
But there is a condition before go to ">", the movie must have info in the page otherwise the position goes to the next line.
Pascal is so strictly!
Is there a tuto for the different way of condition If, i never know the exact syntax, if there is one or two or .... conditions, if we must write ";". I lost a lot of time with this.
I tried different ways but i obtain always an error or the data (of year) is empty!
Just a another question, is there a number limited of logmessage by script because i see somes logmessage give me an error, the syntax was correct and when they are desactived, all is perfect!
i'm again so sorry for my poor english!
[attachment deleted by admin]
-
1.) Very good job.
2.) Pascal is so strictly!
I'm not familiar with Pascal writing.
3. ) In the "year" I had a similar problem, so I eliminated the "Year" from the transfer of data as it is not so important information (concerning the transfer and extract data - the script works better that way).
4.) Just a another question, is there a number limited of logmessage by script because i see somes logmessage give me an error, the syntax was correct and when they are desactived, all is perfect!
I do not know (maybe someone else knows more about it), but if you really do not need it is better to deactivate or even remove the log message.
5. ) Small correction:
This code for BIO
if Lien <> '' then
Lien := Lien + #13;
if URL <> '' then
Lien := Lien + '<link url="' + URL + '">';
Lien := Lien + Name + '</link>';
//if URL1 <> '' then
//Lien := Lien + '<link url="' + URL1 + '">';
//Lien := Lien + Name + '</link>';
if Year <> '' then
Lien := Lien + ' • ' + Year;
//if Role <> '' then
//Lien := Lien + ' • ' + Role;
transferred to wrong url link to the movies, but this correction code
if Lien <> '' then
Lien := Lien + #13;
// if URL <> '' then
// Lien := Lien + '<link url="' + URL + '">';
//Lien := Lien + Name + '</link>';
if URL1 <> '' then
Lien := Lien + '<link url="' + URL1 + '">';
Lien := Lien + Name + '</link>';
if Year <> '' then
Lien := Lien + ' • ' + Year;
//if Role <> '' then
//Lien := Lien + ' • ' + Role;
now transferred to the correct url link to the movies.
-
Ok thanks works good!
For Get Year :
declare actposstart3 if is not
// Get Year
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Year := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage(Year);
end;
Now is it possible to obtain in this script, the titles of movies where this actor plays in the database. (The list in the buttom)
Another question :
If we start the script from an actor "A", can we obtain the ID of an other actor who is in the database?
-
For Get Year :
Thanks
For certain players not transfer info data as is the case here:
http://www.egafd.com/actresses/details.php/id/a00004
http://www.egafd.com/actresses/details.php/id/j00012
http://www.egafd.com/actresses/details.php/id/k00007
http://www.egafd.com/actresses/details.php/id/l00451
http://www.egafd.com/actresses/details.php/id/m00958
http://www.egafd.com/actresses/details.php/id/n00481
especially at this url:
http://www.egafd.com/actresses/details.php/id/a01022
http://www.egafd.com/actresses/details.php/id/b00117
http://www.egafd.com/actresses/details.php/id/d00140
http://www.egafd.com/actresses/details.php/id/j00652
http://www.egafd.com/actresses/details.php/id/k00487
http://www.egafd.com/actresses/details.php/id/m01376
It is interesting that in all these URL addresses egafd_people_mod.psf script makes transfer all info data under these headings, as well as actresses pictures or pictures with the words "No Picture Available".
-
Exact ???
-
For certain players not transfer info data as is the case here:
http://www.egafd.com/actresses/details.php/id/a00004
http://www.egafd.com/actresses/details.php/id/j00012
http://www.egafd.com/actresses/details.php/id/k00007
http://www.egafd.com/actresses/details.php/id/l00451
http://www.egafd.com/actresses/details.php/id/m00958
http://www.egafd.com/actresses/details.php/id/n00481
especially at this url:
http://www.egafd.com/actresses/details.php/id/a01022
http://www.egafd.com/actresses/details.php/id/b00117
http://www.egafd.com/actresses/details.php/id/d00140
http://www.egafd.com/actresses/details.php/id/j00652
http://www.egafd.com/actresses/details.php/id/k00487
http://www.egafd.com/actresses/details.php/id/m01376
It is interesting that in all these URL addresses egafd_people_mod.psf script makes transfer all info data under these headings, as well as actresses pictures or pictures with the words "No Picture Available".
That this is perhaps how to fix that will work for all URLs addresses.
-
Sorry, it's my first script!
I don't understand "egafd_people_mod.psf script makes transfer all info data under these headings".
-
Sorry, it's my first script!
I don't understand "egafd_people_mod.psf script makes transfer all info data under these headings".
I just wanted to say this, that this script transfers the images actresses as well as titles of films, because usually when something is missing information that your egafd_people (2). psf script does not transfer any data.
-
I'm just triying egafd_people_mod.psf script with the URL up and tonight all is good, i don't understand.
Yesterday they didn't work???
My connection is low perhaps is for this reason ?
Now egafd_people(2).psf doesn't work, and i don't know what i had changed. The script find the good URL, the good name and block when he "GET" the page before the execution of ParsePeople! So it's not the default of data who is in cause!
-
Now at least I hope so we solve problems around this or will this solve the problem.
For certain players not transfer info data as is the case here:
http://www.egafd.com/actresses/details.php/id/a00004
http://www.egafd.com/actresses/details.php/id/j00012
http://www.egafd.com/actresses/details.php/id/k00007
http://www.egafd.com/actresses/details.php/id/l00451
http://www.egafd.com/actresses/details.php/id/m00958
http://www.egafd.com/actresses/details.php/id/n00481
especially at this url:
http://www.egafd.com/actresses/details.php/id/a01022
http://www.egafd.com/actresses/details.php/id/b00117
http://www.egafd.com/actresses/details.php/id/d00140
http://www.egafd.com/actresses/details.php/id/j00652
http://www.egafd.com/actresses/details.php/id/k00487
http://www.egafd.com/actresses/details.php/id/m01376
It is interesting that in all these URL addresses egafd_people_mod.psf script makes transfer all info data under these headings, as well as actresses pictures or pictures with the words "No Picture Available".
That this is perhaps how to fix that will work for all URLs addresses.
egafd_people (3)(Ivek23).psf is attached
This script removes all problems and works great (perfect) for me, at least as far as I have done tests so far.
If this is okay now, or it could be in a similar way fix the egafd_movie. psf script.
[attachment deleted by admin]
-
Ok thanks, works good!
Just change URL to URL1 in :
Lien := Lien + '<link url="' + URL1 + '">';
If no notes ------> error in my script.
But i don't understand why!
The error is in the function ParsePeople and i put a logmessage in ParsePage before the call of ParsePeople and i don't see it in the log.
Just an another question, can we insert TAB in field Biography, for visually align notes of movie.
I tried manually with <TAB> but don't work, i tried too add 	 in script but this give me an error.
I tried too : Calculate the number of caracter of each movie, take the bigest, make the difference between the length of each movie, but as each caracter have not the same width the result is not align.
-
Sorry,
Reading help, i've seen that we can modify the field Bio in a skin file .xml.
I've seen that you're an expert (IVEK23 real good skins)!
I know nothing about skin, i tried to modify one skin in putting :
<Link memo valsperline="2"/>, before the line <bio/> ---> give an error. (no egality)
If it works i'll modify the script egafd_people later!
have you a link for learning to make an xml ?
-
I've seen that you're an expert (IVEK23 real good skins)!
Thanks.
I studied other skin which is available via auto-update system and worked experiments until I really had made the skin for his taste.
If you have a link for learning to make an xml ?
Link for help and learning: http://www.videodb.info/help/hlp_skins.html
I know nothing about skin, i tried to modify one skin in putting :
<Link memo valsperline="2"/>, before the line <bio/> ---> give an error. (no egality)
What exactly are you going to say this and what to do with this. Describe a little more to help.
-
I have seen this page but i don't know how use the infos!
How use the properties, how write?
Up, i say i take a xml skin, and i tried to add this line <link memo...., because in the help page this propertie valsperline=”X” says Number of separate values that should be shown on one line. So if i can separate the link of movie and note of this movie, perhaps i'll can align them.
i tried for example add </italic> manually in the field between the link and the notes but doesn't work!
So i need a tutoriel for learning to use the help? ;D
What i can write directly in the field, (like <Link url=....) and what i must write in a xml?
I don't know if i'am clear!
-
If you do not mind, would have answered the skin in the morning.
I'm in Bio adding links movies that are now in the movies section (see picture attached).
egafd_people (4)(Ivek23).psf is attached
[attachment deleted by admin]
-
Thanks,
Extra but with this method the list of movie in the database risk growing rapidly, even if you don't have the movie.
This for this reason i opted for the first solution (the list just for info).
It's for this too, i asked up if it was possible to know in the script the movie who are also in database for not write them two times in the biography and in the filmography.
But filters are here for that i suppose!
-
Suggestion :
Declare Origt
After Get Movie
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
AddPersonMovie(Trim(OrigT), '', '', Year, LowerCase(URL1), ctActors);
That's reduce the number of new Database Movie, just original title.
-
I apologize for the late reply.
As far as I found out I would like to change People skin.
People section does not allow custom fields, for now does not (version 1 is also supposed to allow).
I know nothing about skin, i tried to modify one skin in putting :
<Link memo valsperline="2"/>, before the line <bio/> ---> give an error. (no egality)
This one is not - does not work - error
The potential is as follows
<tab>
<caption>&Biography</caption>
<color>$E0ECFE</color>
<row>
<column halign="center">
<fieldlabel field="bio" />
</column>
</row>
<row>
<column>
<bio collapsedlines="3" valsperline="1">
<font>
<size>11</size>
<name>Arial Black</name>
</font>
</bio>
</column>
</row>
</tab>
or <color>$E0ECFE</color>
<row>
<column halign="center">
<fieldlabel field="bio" />
</column>
</row>
<row>
<column>
<bio collapsedlines="3" valsperline="1">
<font>
<size>10</size>
<!-- <name>Arial Black</name> -->
</font>
</bio>
</column>
</row>
This is also the approximate answer to this:
I have seen this page but i don't know how use the infos!
How use the properties, how write?
Up, i say i take a xml skin, and i tried to add this line <link memo...., because in the help page this propertie valsperline=”X” says Number of separate values that should be shown on one line. So if i can separate the link of movie and note of this movie, perhaps i'll can align them.
i tried for example add </italic> manually in the field between the link and the notes but doesn't work!
So i need a tutoriel for learning to use the help?
What i can write directly in the field, (like <Link url=....) and what i must write in a xml?
I don't know if i'am clear!
If for example in the skin Bio box do it Url hyperlink (as shown in the attached picture), then those in xml skin not necessary to enter anything.
However, I suggest you to look for the movie section topic My current skin for Ivek23 (http://www.videodb.info/forum_en/index.php/topic,2249.0.html) and download the skin pvd_movie_tabs_normal extra AllMovie. (http://www.videodb.info/forum_en/index.php/topic,2249.msg12528.html#msg12528)
For the People section of the skin PVD Personal ITabs (http://www.videodb.info/forum_en/index.php?action=down) and periodically review each of them and reorder them, thus you will also gain knowledge about the skins, at least I hope so.
If you do not know anything, but write a topic in the Support board and you will probably receive an answer to the question.
[attachment deleted by admin]
-
Thanks a lot,
I'll read all and hope i'll die less stupid after! :-[
-
// Get Role (Now defined)
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart4 := PosFrom('> <i>', HTML, actPosStart)
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart4); // search for url end
Role := Trim(Copy(HTML, (actPosStart4 + 5), (actPosEnd - actPosStart4 - 5) ));
LogMessage(Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
In egafd_people (2). psf script I tried to add Role, but we do not manage to add a Role in Bio field. Would you try to add this to the script.
Thank you in advance.
-
I'll try.
In the meantime i modified the script iafd_people in the same idea that egafd_people.
I desactived somes infos, especially the section //Web Site because there's a little bug.
The text in the fieldBio (mode modify) is correct but in mode "design" the first movie of the filmographie go up the link of the website!
I don't know why.
If you're interested i post it.
[attachment deleted by admin]
-
For Role :
Just after Year,
// Get Role (Not yet defined)
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
AddPersonMovie(Trim(Title), '', '', Year, LowerCase(URL1), ctActors);
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Role <> '' then
Lien := Lien + ' • ' + Role;
It seems to be OK.
And for separate Year to notes :
Replace //Get Year by this :
//Notes :
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
///Get Year & Note :
tmpYear := Copy(Notes, 0, 2);
logMessage('tmpYear :' + tmpYear);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,2,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
and :
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
It seems to be Ok too, but perhaps i have not seen all differents cases!
I've noted that if there's no "Notes" after a movie, the next movie does not appears in the bio, seems to again function Posfrom don't step to the good place!
-
//Notes :
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
///Get Year & Note :
tmpYear := Copy(Notes, 0, 2);
logMessage(Notes);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,2,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
This code is OK, but no work yet.
Add your script, that it tested and to see why my modifies script does not work.
-
I post the code egafd_people(Role).psf.
For me the code is OK!
Have you declare all new variable? (notes, note, tmpYear...)
In what URL have you tested it ?
I'm seeing an error :
change in case 'c.' : -----> Year := Copy(Notes,4,4);
Still stay the problem of the movies who are not reed after a movie within "notes"!
[attachment deleted by admin]
-
I found the problem, tmpYear wrong. I like this set tmpYear : Integer; , but not like this tmpYear : String;
Rest tomorrow.
-
I think temYear must be a string. tmpYear is just the two firsts letters of "notes" to know what style of date is writen in the page.
We work in a text for search data. (in the case of 1980s or 1980? or c.1980),
and the problem already existed before the modification.
We can translate Year in integer before addPersonMovie, but for search value i think we must stay in string.
I think is the develpoment of the script who is en cause.
If there's not "Role" after actual line movie search the function PosFrom find the "Role" of the movie in the next line.
We must make a condition before searching //Get role
I've taken for example to work in script this url : http://www.egafd.com/actresses/details.php/id/n00008
There's many case of date.
-
I found this solution, it's not not very elegant but it's OK
// Get Role (Not yet defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
{actPosStart := PosFrom('> <i>', HTML, actPosStart) + 6;}
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
Perhaps it can have exeptions, in this case we must modify the number of difference (here 200).
-
Just a little modification in the case where the last movie in the list has not "role".
// Get Role (Not yet defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
-
As a suggestion up,
I add this :
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
and :
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
So in the list of movie in Field Bio, there's only link with original title!
I think it's clearly.
-
Just a little modification in the case where the last movie in the list has not "role".
// Get Role (Not yet defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
THANK YOU.
This code is now excellent it works.
As a suggestion up,
I add this :
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
and :
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
So in the list of movie in Field Bio, there's only link with original title!
I think it's clearly.
True, it is more transparent, to see the original movie links, which is very nice.
Thank you again.
BTW:
I tried to EGAFD MOVIE SCRIPT in section Cast add Role with this code or part of the code:
// Get Role
actPosStart := PosFrom('href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('</a> <', HTML, actPosStart)
actPosEnd:=PosFrom('</', HTML, actPosStart2); // search for url end
Role := Trim(Copy(HTML, (actPosStart2 + 7), (actPosEnd - actPosStart2 - 7) ));
LogMessage(Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
AddMoviePerson(Trim(Name), '', Role, LowerCase(URL), ctActors);
which should look like this in whole code
//Cast
curPos:= Pos('<th>Actresses</th>', HTML);
LogMessage('Cast readout');
if curPos > 0 then begin
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('>', HTML, UrlPosStart); // search for url end
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart + 6, (UrlPosEnd - UrlPosStart - 7) ));
LogMessage(URL);
// Get Name
actPosStart := PosFrom('href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
// Get Role
actPosStart := PosFrom('href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('</a> <', HTML, actPosStart)
actPosEnd:=PosFrom('</', HTML, actPosStart2); // search for url end
Role := Trim(Copy(HTML, (actPosStart2 + 7), (actPosEnd - actPosStart2 - 7) ));
LogMessage(Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
AddMoviePerson(Trim(Name), '', Role, LowerCase(URL), ctActors);
curPos := PosFrom('href="', HTML, actPosEnd);
end;
end;
but does not work.
That is what changed.
-
It's a good idea, if we can put role.
I made somes tests with egafd_movie and saw there's many bugs!
The same that we had first with egafe_people; If an info fail, the script doesn't give data.
I'll try to see that tomorow!
I made two minor modif in egafd_people, for vision only :
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
Born := Uppercase(Copy(Born,0,1)) + Copy(Born,2, length(Born)-1) + #13;
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '----- Filmography (EGAFD) -----' + #09;
EndPos := curPos;
-
I made two minor modif in egafd_people, for vision only :
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
Born := Uppercase(Copy(Born,0,1)) + Copy(Born,2, length(Born)-1) + #13;
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '----- Filmography (EGAFD) -----' + #09;
EndPos := curPos;
I have a better and simple solution, the effect is the same as before.
// Total Line
If Lien <> '' then
Lien := Lien + #13;
...
...
...
LogMessage('LIEN :' + Lien);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
if (Lien <> '') AND (Born = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born <> '') then
AddFieldValue(pfBio, Born + #13 + #13 + Lien);
end;
I modified the part of the Bio code
//If Title:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 11) = 'alternative' then
Title := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
Title := OrigT;
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
and
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If Title <> OrigT then
Lien := Lien + Name
else
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
and now, in addition to Original Title also that Title, which are not Alternative Title.
Not the best.
In Bio movie list is not as transparent as yours, I like it, Of course, if that is what change is also OK.
Could be done in BORN that all was as up to now, Birthplace field arranged so that there are visible such data like these for example:
Czech, b. 1985
Hungarian. b. 1978
-
Thanks,
i'll see that later becaause i live in the middle of nowhere and the connection is very very slow during the day!
For "role" in egafd movie :
// -------------- Procedure ParseMovie --------------//
// - after searchlist selection this function is called with the new html content
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, EndPos, P, P2, L: Integer;
actPosStart,actPosStart2,
actPosEnd, UrlPosStart,UrlPosEnd,debug_pos1:Integer;
Tmp, URL, Name,dbgstrg,tmpstrg, Role : String;
ActorNames: TWideArray;
ActorNumber,I,J: Integer;
/////
begin
AddFieldValue(mfURL, MovieURL);
LogMessage('Page parsing started');
EndPos := 1;
//Check for title. No orig. title info present, so duplicate..
dbgstrg:= TextBetween(HTML, '<title>', '</title>', False, EndPos);
LogMessage('Title: ' + dbgstrg);
If dbgstrg <> '' then begin
AddFieldValue(mfOrigTitle,dbgstrg);
AddFieldValue(mfTitle,dbgstrg);
end;
//Year
dbgstrg := '';
CurPos := Pos('Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfYear,dbgstrg);
//Director
dbgstrg := '';
curPos := Pos('Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
If dbgstrg <> '' then
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
//Notes
dbgstrg := '';
curpos := Pos('Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfDescription, dbgstrg);
//AKA - Titles...
dbgstrg := '';
LogMessage('getting all titles')
Curpos := Pos('<th>Alternate Titles</th>' ,HTML);
EndPos := curPos;
////
while (curPos > 0) AND (curPos < PosFrom('<th>Actresses</th>', HTML, EndPos)) do begin
EndPos := curPos;
actPosStart := PosFrom('class="flma"', HTML, EndPos);
actPosEnd := PosFrom('</span>', HTML, actPosStart);
dbgstrg := Trim(Copy(HTML, (actPosstart + 13), (actPosEnd - actPosStart - 13) ));
LogMessage('AKA: ' + dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfAka, dbgstrg);
curpos := PosFrom('class="flma"', HTML, actPosEnd);
////
end;
//Cast
curPos:= Pos('<th>Actresses</th>', HTML);
LogMessage('Cast readout');
/////
if curPos > 0 then begin
EndPos := curPos;
///
while (curPos > 0) AND (curPos < PosFrom('<th>Notes</th>', HTML, EndPos)) do begin
EndPos := curPos;
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos);
UrlPosEnd := PosFrom('">', HTML, UrlPosStart);
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart + 6, (UrlPosEnd - UrlPosStart - 7) ));
LogMessage(URL);
// Get Name
//actPosStart := PosFrom('href="', HTML, EndPos); // search for url start;
//actPosStart2 := PosFrom('">', HTML, actPosStart)
//actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
//Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
//LogMessage(Name);
{Name := TextBetween(HTML, '">', '</a>', false, urlpostart);}
// Get Name
actposstart := urlposend + 2;
actposend := Posfrom('</a>', HTML, actposstart);
Name := Trim(Copy(HTML, actposstart, (actposend-actposstart)));
Logmessage('Name: ' + Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage('Name:' + Name);
// Role
Role := '';
actposStart := actposend;
If (copy(HTML, actposstart + 4, 1)) <> '<' then begin
actposStart := actposstart -6;
Role := TextBetween(HTML, '<i>', '</i>', false, actposstart);
end;
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role := Copy(Role,0,debug_pos1-1);
LogMessage('Role:'+ Role);
If URL <> '' then
If Name <> '' then
AddMoviePerson(Trim(Name), '', Role, LowerCase(URL), ctActors);
curPos := PosFrom('href="', HTML, actPosEnd);
///
end;
/////
end;
/////
end;
It seems to be OK!
-
Sorry, i don't understand your modification!
Certainly i made mistakes in modifying my code!
could you post your total code of Parse people?
I'm noting two errors in the code up :
If no "Notes" in the web page :
//Cast
curPos:= Pos('<th>Actresses</th>', HTML);
LogMessage('Cast readout');
If pos('<th>Notes</th>', HTML) > 0 then
endListStr := '<th>Notes</th>'
else
endListStr := '>Suppliers</th>';
/////
if curPos > 0 then begin
EndPos := curPos;
///
while (curPos > 0) AND (curPos < PosFrom(endlistStr, HTML, EndPos)) do begin
and an error in getting URL of actresse :
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos) + 6;
UrlPosEnd := PosFrom('">', HTML, UrlPosStart);
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart, UrlPosEnd - UrlPosStart));
LogMessage(URL);
-
You can wait two or three days because I was half collapsed computer and I can not get to certain files. Thank you for understanding.
-
No problem, good courage!
-
I'm back.
Certainly i made mistakes in modifying my code!
could you post your total code of Parse people?
Here is a complete Procedure Parse people code
//--------------------Procedure parse people-----------------
procedure ParsePeople(URL : String; HTML : String);
var curpos, endpos, PosStart, PosEnd, debug_Pos1, difpos : Integer;
actPosstart, actposstart2, actPosStart3, actPosStart4, actposend, UrlposStart, UrlposEnd : Integer;
Pseudo, Born, Lien, URL1, Name, OrigT, Title, Year, Av, Role, Notes, Note, tmpYear : String;
begin
//URL
Addfieldvalue(pfURL,URL);
//BORN:
curpos := Pos('<th>Notes</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('</tr>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('<td><ul class="list"><li>', HTML, endpos);
PosEnd := PosFrom('</li></ul></td>', HTML, PosStart);
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
//LogMessage('BORN :' + Born);
curpos := posfrom('<td><ul class="list"><li>', HTML, posend);
if Born <> '' then
//AddFieldValue(pfBirthplace, Born);
LogMessage('BORN :' + Born);
end;
//AKA:
curpos := Pos('<th>Pseudonyms</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('<th>Films</th>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('class="acta">', HTML, endpos);
PosEnd := PosFrom('</span>', HTML, PosStart);
Pseudo := Trim(Copy(HTML, (PosStart + 13), (PosEnd - PosStart - 13)));
LogMessage('AKA :' + Pseudo);
curpos := posfrom('class="acta">', HTML, posend);
if Pseudo <> '' then
AddFieldValue(pfAltnames, Pseudo);
end;
//BIO:
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '';
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
// get url
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) );
LogMessage(URL1);
(* // get url (for example)
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Trim(Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) ));
LogMessage(URL1);
*)
// Get Name
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
(* // Get Title (for movies)
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Title := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Title);
debug_pos1:=Pos('(',Title);
if debug_pos1 >0 then
Title := Copy(Title,0,debug_pos1-1);
LogMessage(Title);
*)
//Notes :
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
///Get Year & Note :
tmpYear := Copy(Notes, 0, 2);
logMessage('tmpYear :' + tmpYear);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,4,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
(* // Get Year
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Year := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage(Year);
end;
debug_pos1:=Pos('(',Year);
if debug_pos1 >0 then
Year:= Copy(Year,0,debug_pos1-1);
LogMessage(Year);
*)
(* // Get Role (Now defined)
actPosStart4 := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i>', HTML, actPosStart4) - 1;
Role := Trim(Copy(HTML, actposStart4, (actPosEnd - actPosStart4)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
*)
// Get Role (Now defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
{actPosStart := PosFrom('> <i>', HTML, actPosStart) + 6;}
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
//AddPersonMovie(Trim(Title), '', Role, Year, LowerCase(URL1), ctActors);
AddPersonMovie(Trim(OrigT), '', Role, Year, LowerCase(URL1), ctActors);
(* // Total Line
if Lien <> '' then
Lien := Lien + #13;
if URL1 <> '' then
Lien := Lien + '<link url="' + URL1 + '">';
Lien := Lien + Name + '</link>';
if Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
if Role <> '' then
Lien := Lien + ' • ' + Role;
*)
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
if (Lien <> '') AND (Born = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born <> '') then
AddFieldValue(pfBio, Born + #13+#13 + Lien);
end;
//Foto
curPos :=Pos('src="/actresses/id/',HTML);
if curPos > 0 then begin
EndPos := PosFrom('" width', HTML, curPos);
PhotoURL := BASE_URL + Copy(HTML, curPos + 5, EndPos - curPos - 5);
LogMessage('URL de la photo: '+ PhotoURL);
{PhotoURL := HTMLToText (PhotoURL);}
AddImageURL(4, PhotoURL);
end
else begin
PhotoURL := '';
end;
end;
Sorry, i don't understand your modification!
I modified the part of the Bio code
Here is a complete Modified Bio code
//BIO:
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '';
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
// get url
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) );
LogMessage(URL1);
(* // get url (for example)
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Trim(Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) ));
LogMessage(URL1);
*)
// Get Name
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
//If Title:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 11) = 'alternative' then
Title := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
Title := OrigT;
//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
(* // Get Title (for movies)
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Title := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Title);
debug_pos1:=Pos('(',Title);
if debug_pos1 >0 then
Title := Copy(Title,0,debug_pos1-1);
LogMessage(Title);
*)
//Notes :
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
///Get Year & Note :
tmpYear := Copy(Notes, 0, 2);
logMessage('tmpYear :' + tmpYear);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,4,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
(* // Get Year
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Year := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage(Year);
end;
debug_pos1:=Pos('(',Year);
if debug_pos1 >0 then
Year:= Copy(Year,0,debug_pos1-1);
LogMessage(Year);
*)
(* // Get Role (Now defined)
actPosStart4 := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i>', HTML, actPosStart4) - 1;
Role := Trim(Copy(HTML, actposStart4, (actPosEnd - actPosStart4)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
*)
// Get Role (Now defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
{actPosStart := PosFrom('> <i>', HTML, actPosStart) + 6;}
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
//AddPersonMovie(Trim(Title), '', Role, Year, LowerCase(URL1), ctActors);
AddPersonMovie(Trim(OrigT), '', Role, Year, LowerCase(URL1), ctActors);
(* // Total Line
if Lien <> '' then
Lien := Lien + #13;
if URL1 <> '' then
Lien := Lien + '<link url="' + URL1 + '">';
Lien := Lien + Name + '</link>';
if Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
if Role <> '' then
Lien := Lien + ' • ' + Role;
*)
// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If Title <> OrigT then
Lien := Lien + Name
else
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
if (Lien <> '') AND (Born = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born <> '') then
AddFieldValue(pfBio, Born + #13 + #13 + Lien);
end;
and now, in addition to Original Title also that Title, which are not Alternative Title.
Not the best.
In Bio movie list is not as transparent as yours, I like it, Of course, if that is what change is also OK.
Is it still your version of this code is better, perhaps it could be something to fix.
-
Thanks, but i always don't understand!
The result is the same as the version before my modification.
//If title and //If Original have the same code (the same effect)!
idem in part of Lien.
I don't find page of an actresse with born info in egafd, if you have links!
-
Thanks, but i always don't understand!
The result is the same as the version before my modification.
//If title and //If Original have the same code (the same effect)!
idem in part of Lien.
OK. This is not deals more and we leave this so as your modification, than if when offered what better solution for this change and prefer let's try to find a solution for this, //BORN:
curpos := Pos('<th>Notes</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('</tr>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('<td><ul class="list"><li>', HTML, endpos);
PosEnd := PosFrom('</li></ul></td>', HTML, PosStart);
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
//LogMessage('BORN :' + Born);
curpos := posfrom('<td><ul class="list"><li>', HTML, posend);
if Born <> '' then
AddFieldValue(pfBirthplace, Born);
LogMessage('BORN :' + Born);
end;
Could be done in BORN that all was as up to now, Birthplace field arranged so that there are visible such data like these for example:
Czech, b. 1985
Hungarian. b. 1978
if possible.
-
For Born,
First Declare variable :
PartBorn : Twidearray;
I : integer
Country, BirhtDay : String;
and after //Born :
////////BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
Country := partBorn[I-1];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
I have not enough exemples of page with "Notes", but where i try it works.
We haven't day and month of birthday!
-
For more security, in the case where there's text before country :
Declare more :
PartBorn2 : twidearray;
J : integer
//BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
ExplodeString(partBorn[I-1], PartBorn2, ' ');
J := High(partBorn2);
Country := partBorn2[J];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
This works only with the type Hungarian. b. 1980 !
-
If you do not mind tomorrow, now regulated and tests egafd_movie script, how it works, the result will be tomorrow.
-
I have tested it,
two little errors fixed it :
//BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If partBorn[I] = 'b' then begin
ExplodeString(partBorn[I-1], PartBorn2, ' ');
J := High(partBorn2);
Country := partBorn2[J];
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
If Copy(partBorn[I], length(partBorn[I])-2,3) = ', b' then begin
ExplodeString(partBorn[I], partBorn2, ',');
J := High(partBorn2);
ExplodeString(partBorn2[J-1], partBorn3, ' ');
J := High(partBorn3);
Country := partBorn3[J];
Birthday := '01/01/' + copy(partborn[I+1],0,4);
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
It's ok for the two solutions!
-
If you do not mind tomorrow, now regulated and tests egafd_movie script, how it works, the result will be tomorrow.
I worked on tests to about 100 movie, adding a few accessories and made some correctionsso far and with a little delay is here egafd_mod7 script for movie attached.
I'm sorry, my mistake, added to the Cast wrong url code,
This is the right URL codes.
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos) + 6;
UrlPosEnd := PosFrom('">', HTML, UrlPosStart);
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart, UrlPosEnd - UrlPosStart));
LogMessage(URL);
ADDED IS NOW ALSO CORRECT egafd_mod7 script for movie attached.
[attachment deleted by admin]
-
Thanks, good work!
It's interesting to add new infos.
But with this method, the info of country for exemple will be always for the last movie of Alternate Titles.
I think it should be better to use the origtitle and compare it with the list of alternate Titles, and if the same title is in the list, we can search data in this line. (of country, if it's a dvd, or studio)
-
For Url
I'm sorry, my mistake, added to the Cast wrong url code,
This is the right URL codes.
// get url
UrlPosStart := PosFrom('href="', HTML, EndPos) + 6;
UrlPosEnd := PosFrom('">', HTML, UrlPosStart);
URL := BASE_URL + Trim(Copy(HTML, UrlPosStart, UrlPosEnd - UrlPosStart));
LogMessage(URL);
ADDED IS NOW ALSO CORRECT egafd_mod7 script for movie attached.
Thanks
What is your best should be.
What is better, it should be.
For egafd people slight adjustment in the Bio // Get Role (Now defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
{actPosStart := PosFrom('> <i>', HTML, actPosStart) + 6;}
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
Role := StringReplace(Role, ';', ' - ', true, false, true);
Role := StringReplace(Role, '/', ' - ', true, false, true);
if Pos(', ', Role) = 1 then Delete(Role, 1, 2);
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
-
Hello,
I think the data of country, dvd ... are not organise in egafd to make that's you want.
If Title is Original, infos are in top, else they are in alternate titles and infos are not separated!
So i opted for this solution, it's not perfect but simple :
Declare altposStart, altposEnd as integer
//AKA - Titles...
dbgstrg := '';
LogMessage('getting all titles')
Curpos := Pos('<th>Alternate Titles</th>' ,HTML);
EndPos := curPos;
////
while (curPos > 0) AND (curPos < PosFrom('<th>Actresses</th>', HTML, EndPos)) do begin
EndPos := curPos;
actPosStart := PosFrom('class="flma"', HTML, EndPos);
actPosEnd := PosFrom('</span>', HTML, actPosStart);
dbgstrg := Trim(Copy(HTML, (actPosstart + 13), (actPosEnd - actPosStart - 13) ));
LogMessage('AKA: ' + dbgstrg);
if Copy(HTML, (actposend + 7), 5) <> '</li>' then begin
AltposEnd := Posfrom('</li>', HTML, actposend);
AltposStart := PrevPos('>', HTML, altPosEnd);
dbgstrg := dbgstrg + ' •' + copy(HTML, (altposstart +1), (altPosEnd - altPosStart-1));
end;
If dbgstrg <> '' then
AddFieldValue(mfAka, dbgstrg);
curpos := PosFrom('class="flma"', HTML, actPosEnd);
////
end;
I taked only the part Notes of alternate title, other infos are not for me very important!
Have you try code for Birthplace and Birthday in egafd people ?
-
Have you try code for Birthplace and Birthday in egafd people ?
Not yet, because I had yesterday morning denied access to the Internet, which I could not fix, so I had a new load computer, so I need time somehow one day or more to add all the programs and the rest of what he needed to operate a computer as needed, so I announced news about this until tomorrow, if the right.
Greeting
-
I had a problem too with access to videobb, a page said me i had virus or spyware who send spam, i made a scan with my antivirus and antispyware and i found nothing. Finally i restarted my computer and my router and all was ok!
????
-
Have you try code for Birthplace and Birthday in egafd people ?
It is fine, but problems occur when certain words like this for example:
Hungarian , b. 1983 <--- no problem
Hungarian or this b. 1983 <--- there's a problem - the script is blocked
Here is the link http://www.egafd.com/actresses/details.php/id/k00071 for classic example of described problems (b. 1978).
Hungarian <--- this problem I just somehow solved
others do not, therefore, egafd_people(4 (Ivek23)10 script attached if they will give what and how to save and improve the script,
[attachment deleted by admin]
-
I haven't seen this exemples.
For b.1978 see this code :
//BirthDay & Birthplace:
ExplodeString(Born, PartBorn, #46);
If High(partBorn) > 0 then
Begin
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If Lowercase(partBorn[I]) = 'b' then begin
If High(partBorn) = 1 then Begin
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
Country := '';
end
else begin
ExplodeString(partBorn[I-1], PartBorn2, ' ');
J := High(partBorn2);
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
Country := partBorn2[J];
end;
end;
If Copy(partBorn[I], length(partBorn[I])-2,3) = ', b' then begin
ExplodeString(partBorn[I], partBorn2, ',');
J := High(partBorn2);
ExplodeString(partBorn2[J-1], partBorn3, ' ');
J := High(partBorn3);
Country := partBorn3[J];
Birthday := '01/01/' + copy(partborn[I+1],0,4);
end;
end;
end;
If Country <> '' then
AddFieldValue(pfBirthPlace, Country);
If BirthDay <> '' then
AddFieldValue(pfBirthday, BirthDay);
For country only can you post a link?
-
For country only can you post a link?
For country only link:
http://www.egafd.com/actresses/details.php/id/v00279
http://www.egafd.com/actresses/details.php/id/t00019
http://www.egafd.com/actresses/details.php/id/s00066
http://www.egafd.com/actresses/details.php/id/r00044
http://www.egafd.com/actresses/details.php/id/o00009
http://www.egafd.com/actresses/details.php/id/n00518
http://www.egafd.com/actresses/details.php/id/n00130
http://www.egafd.com/actresses/details.php/id/n00047
http://www.egafd.com/actresses/details.php/id/k00333
http://www.egafd.com/actresses/details.php/id/j00106
http://www.egafd.com/actresses/details.php/id/j00041
http://www.egafd.com/actresses/details.php/id/i00028
http://www.egafd.com/actresses/details.php/id/g00361
http://www.egafd.com/actresses/details.php/id/g00339
http://www.egafd.com/actresses/details.php/id/g00077
http://www.egafd.com/actresses/details.php/id/g00320
http://www.egafd.com/actresses/details.php/id/f00059
http://www.egafd.com/actresses/details.php/id/e00056
http://www.egafd.com/actresses/details.php/id/a00750
For link, where the partial incorrectly data transfer for example like this:
http://www.egafd.com/actresses/details.php/id/v00195
series, b. 1978
http://www.egafd.com/actresses/details.php/id/r00061
origin, b. 1976
French, Algerian origin, b. 1976
http://www.egafd.com/actresses/details.php/id/l00281
breast. b. 1980
Hungarian. ..... breast. b. 1980
http://www.egafd.com/actresses/details.php/id/l00129
arm. b. 1982
Hungarian blonde, tattoo upper right arm. b. 1982
http://www.egafd.com/actresses/details.php/id/f00165
resident, b. 1969
Congolese (Brazzaville), French resident, b. 1969
http://www.egafd.com/actresses/details.php/id/d00042
origin, b. 1968
French, Moroccan origin, b. 1968
http://www.egafd.com/actresses/details.php/id/c00453
arm. b. 1980
Hungarian, tattoo right shoulder / upper arm. b. 1980
http://www.egafd.com/actresses/details.php/id/a00493
blade. b. 1984
French. tattoos .... blade. b. 1984
http://www.egafd.com/actresses/details.php/id/a00672
blade. b. 1980
Spanish, tattoos .... blade. b. 1980
http://www.egafd.com/actresses/details.php/id/a00266
shoulder. b. 1983
French. .... shoulder. b. 1983
For link, which do not transfer any data for example like this:
http://www.egafd.com/actresses/details.php/id/t00012
French-Canadian
http://www.egafd.com/actresses/details.php/id/s00841
Hungarian,
http://www.egafd.com/actresses/details.php/id/p00088
French, black African ethnic origin
http://www.egafd.com/actresses/details.php/id/n00033
Ukrainian, b. 1973 or 1977?
http://www.egafd.com/actresses/details.php/id/m01654
Bulgarian,
http://www.egafd.com/actresses/details.php/id/m00170
Hungarian,
http://www.egafd.com/actresses/details.php/id/m00671
mature, French
http://www.egafd.com/actresses/details.php/id/l01065
probably Hong Kong Chinese
http://www.egafd.com/actresses/details.php/id/l00073
French brunette,
http://www.egafd.com/actresses/details.php/id/l00056
French (Breton)
http://www.egafd.com/actresses/details.php/id/l00103
French,
http://www.egafd.com/actresses/details.php/id/k00045
French (Vietnamese father), b.1979,
http://www.egafd.com/actresses/details.php/id/k00026
French, 1973 - 2005, R.I.P.
http://www.egafd.com/actresses/details.php/id/j00037
Portuguese, French-based (according to some sources anyway)
http://www.egafd.com/actresses/details.php/id/i00080
Polish or Hungarian?, b. 1978
http://www.egafd.com/actresses/details.php/id/g00204
b. 1986, tattoo right upper arm, ....
http://www.egafd.com/actresses/details.php/id/g00056
Polish, spot ....
http://www.egafd.com/actresses/details.php/id/f00124
German, brunette, ....
http://www.egafd.com/actresses/details.php/id/e00153
French, blonde, mature, ....
http://www.egafd.com/actresses/details.php/id/d00548
Bulgarian, tattoo ....
http://www.egafd.com/actresses/details.php/id/a00104
French, tattoo ....
http://www.egafd.com/actresses/details.php/id/a01156
Bulgarian, tattoo ....
http://www.egafd.com/actresses/details.php/id/a00064
Russian / Kyrgyzstan
http://www.egafd.com/actresses/details.php/id/a00151
French,
http://www.egafd.com/actresses/details.php/id/a00053
Hungarian, b. 1970 (or 1968?), ....
http://www.egafd.com/actresses/details.php/id/b00121
Hungarian, b. 1974?
http://www.egafd.com/actresses/details.php/id/b00004
French, but according to IMDB, born Fort Worth, Texas
BTW:
How do you work with code the word Birthday ,because it does not work for me and I had to replace the word Birthplace , it works.
-
Thanks,
There's too many different type of string for use my code!
We only can utilise it for birthday, and for country we can utilise your code with Pos.....
But we must have all country possible in list.
Sorry for birthday or birthplace, i'm not at home for the moment, so i have not VDB for making test, i work only with script file.
-
Sorry for birthday or birthplace, i'm not at home for the moment, so i have not VDB for making test, i work only with script file.
No problem, we will wait that you will soon come home again.
-
Changes for egafd_mod9 script for movie :
- Corrected DVD code, it now adds DVD information, where information is added to the movie title (by the end of the movie title)
- Country and Studio code I edited so that now the Country and Studio info data are both united in one whole and transferred in Tags box.
egafd_mod9 script for movie attached
[attachment deleted by admin]
-
I added MPAA, I cleaned the script redundant parts of the code whose parts are not necessary for the proper functioning of the script.
egafd_mod10 script for movie attached
[attachment deleted by admin]
-
I'm back,
Thanks for egafd movie, i'll examine it!
Code for birthday and birthplace :
procedure ParsePeople(URL : String; HTML : String);
///////////////////////////////////////////////////////////////////////////////////////////////////
var curpos, endpos, PosStart, PosEnd, debug_Pos1 : Integer; //
actPosstart, actposstart2, actPosStart3, actposend, UrlposStart, UrlposEnd, difPos : Integer;//
Pseudo, Born, Lien, URL1, Name, Title, Year, Av, Role, Notes, Note, tmpYear, OrigT : String;
posBorn, Country, Birthday : string;
I, counter : integer; //
///////////////////////////////////////////////////////////////////////////////////////////////////
begin
AddFieldValue(pfGenre, 'EGAFD');
// URL: //
Addfieldvalue(pfURL,URL);
// BORN: //
curpos := Pos('<th>Notes</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('</tr>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('<td><ul class="list"><li>', HTML, endpos);
PosEnd := PosFrom('</li></ul></td>', HTML, PosStart);
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
Born := Uppercase(Copy(Born,0,1)) + Copy(Born,2, length(Born)-1) + #13;
//LogMessage('BORN :' + Born);
curpos := posfrom('<td><ul class="list"><li>', HTML, posend);
//AddFieldValue(pfBirthplace, Born);
LogMessage('BORN :' + Born);
end;
/// BirthDay:
ExplodeString(Born, PartBorn, #46);
If High(partBorn) > 0 then
Begin
logmessage('birhtday commence')
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If (Lowercase(partBorn[I]) = 'b') OR (Copy(partBorn[I], length(partBorn[I])-2,3) = ', b') then
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If BirthDay <> '' then AddFieldValue(pfBirthday, BirthDay);
// Birthplace:
TabCountry := ['Hungarian', 'French', 'Russian', 'Norwegian' , 'Austrian', 'Spanish', 'Bulgarian'
, 'English', 'German', 'Belgian', 'Canadian', 'Danish', 'Italian', 'Greek'
, 'Portuguese', 'Polish', 'Kyrgyzstan', 'Czech', 'exit'];
I := 0;
For I := Low(TabCountry) to High(Tabcountry) do
Begin
If Pos((copy(TabCountry[I], 1 ,Length(TabCountry[I])-1)),Born) > 0 then
Begin
Addfieldvalue(pfBirthPlace, TabCountry[I]);
I := High(TabCountry);
end;
End;
// AKA: //
curpos := Pos('<th>Pseudonyms</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('<th>Films</th>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('class="acta">', HTML, endpos);
PosEnd := PosFrom('</span>', HTML, PosStart);
Pseudo := Trim(Copy(HTML, (PosStart + 13), (PosEnd - PosStart - 13)));
LogMessage('AKA :' + Pseudo);
curpos := posfrom('class="acta">', HTML, posend);
AddFieldValue(pfAltnames, Pseudo);
end;
//////////
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '----- Filmographie (EGAFD) -----' + #09;
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
/// Get URL: ///
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) );
LogMessage(URL1);
/// Get Name: ///
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
/// Get Title (for movies): ///
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Title := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Title);
debug_pos1:=Pos('(',Title);
if debug_pos1 >0 then
Title := Copy(Title,0,debug_pos1-1);
LogMessage(Title);
/// If Original: ///
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
/// Notes: ///
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
/// Get Year & Note: ///
tmpYear := Copy(Notes, 0, 2);
logMessage('tmpYear :' + tmpYear);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,4,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
/// Get Role: ///
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
Role := StringReplace(Role, ';', ' - ', true, false, true);
Role := StringReplace(Role, '/', ' - ', true, false, true);
if Pos(', ', Role) = 1 then Delete(Role, 1, 2);
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
{AddPersonMovie(Trim(OrigT), '', '', Year, LowerCase(URL1), ctActors);} //Add movie in database
/// Total Line: ///
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
//////////
if (Lien <> '') AND (Born = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born <> '') then
AddFieldValue(pfBio, Born + #13#10 + Lien);
end;
// Photo:
curPos :=Pos('src="/actresses/id/',HTML);
if curPos > 0 then begin
EndPos := PosFrom('" width', HTML, curPos);
PhotoURL := BASE_URL + Copy(HTML, curPos + 5, EndPos - curPos - 5);
LogMessage('URL de la photo: '+ PhotoURL);
{PhotoURL := HTMLToText (PhotoURL);}
AddImageURL(4, PhotoURL);
end
else begin
PhotoURL := '';
end;
end;
for me 'birthday' works!
We must complete the list of country, i had certainly forgotten somes!
There are somes exeptions like French-Canadian, origin. This code takes only the first country and doesn't take care of origin.
I made some tests with urls up and it seems to be ok
-
Welcome back.
I tried to declare "mfComment = 16;" but no data are transfered!
My problem is to write "notes" in field comment and not in field description!
I tried to declare "mfComment = 16;" but no data are transfered!
As the first "mfComment" not yet exist and does not work yet.
Moreover, this also partially true, but there is also a solution to this problem that I have found these days in zelluloid_person script (http://www.videodb.info/forum_en/index.php/topic,1033.msg14624.html#msg14624) as an extra link, a link to the Comment field.
So it could be better info download certain information in the comment box where more so than not, they really belong there.
zelluloid_person script download link (http://www.videodb.info/forum_en/index.php?action=dlattach;topic=1033.0;attach=3587)
-
Code for birthday and birthplace :
procedure ParsePeople(URL : String; HTML : String);
///////////////////////////////////////////////////////////////////////////////////////////////////
var curpos, endpos, PosStart, PosEnd, debug_Pos1 : Integer; //
actPosstart, actposstart2, actPosStart3, actposend, UrlposStart, UrlposEnd, difPos : Integer;//
Pseudo, Born, Lien, URL1, Name, Title, Year, Av, Role, Notes, Note, tmpYear, OrigT : String;
posBorn, Country, Birthday : string;
I, counter : integer; //
///////////////////////////////////////////////////////////////////////////////////////////////////
begin
AddFieldValue(pfGenre, 'EGAFD');
// URL: //
Addfieldvalue(pfURL,URL);
// BORN: //
curpos := Pos('<th>Notes</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('</tr>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('<td><ul class="list"><li>', HTML, endpos);
PosEnd := PosFrom('</li></ul></td>', HTML, PosStart);
Born := Trim(Copy(HTML, (PosStart + 25), (PosEnd - PosStart - 25)));
Born := Uppercase(Copy(Born,0,1)) + Copy(Born,2, length(Born)-1) + #13;
//LogMessage('BORN :' + Born);
curpos := posfrom('<td><ul class="list"><li>', HTML, posend);
//AddFieldValue(pfBirthplace, Born);
LogMessage('BORN :' + Born);
end;
/// BirthDay:
ExplodeString(Born, PartBorn, #46);
If High(partBorn) > 0 then
Begin
logmessage('birhtday commence')
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If (Lowercase(partBorn[I]) = 'b') OR (Copy(partBorn[I], length(partBorn[I])-2,3) = ', b') then
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If BirthDay <> '' then AddFieldValue(pfBirthday, BirthDay);
// Birthplace:
TabCountry := ['Hungarian', 'French', 'Russian', 'Norwegian' , 'Austrian', 'Spanish', 'Bulgarian'
, 'English', 'German', 'Belgian', 'Canadian', 'Danish', 'Italian', 'Greek'
, 'Portuguese', 'Polish', 'Kyrgyzstan', 'Czech', 'exit'];
I := 0;
For I := Low(TabCountry) to High(Tabcountry) do
Begin
If Pos((copy(TabCountry[I], 1 ,Length(TabCountry[I])-1)),Born) > 0 then
Begin
Addfieldvalue(pfBirthPlace, TabCountry[I]);
I := High(TabCountry);
end;
End;
// AKA: //
curpos := Pos('<th>Pseudonyms</th>', HTML);
endpos := curpos;
While (curpos > 0) AND (curpos < Posfrom('<th>Films</th>', HTML, EndPos)) do begin
endpos := curpos;
PosStart := PosFrom('class="acta">', HTML, endpos);
PosEnd := PosFrom('</span>', HTML, PosStart);
Pseudo := Trim(Copy(HTML, (PosStart + 13), (PosEnd - PosStart - 13)));
LogMessage('AKA :' + Pseudo);
curpos := posfrom('class="acta">', HTML, posend);
AddFieldValue(pfAltnames, Pseudo);
end;
//////////
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '----- Filmographie (EGAFD) -----' + #09;
EndPos := curPos;
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, EndPos)) do begin
EndPos := curPos; // Set last position to actual position
/// Get URL: ///
UrlPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start
UrlPosEnd := PosFrom('" class="', HTML, UrlPosStart); // search for url end
URL1 := BASE_URL + Copy(HTML, UrlPosStart + 9, (UrlPosEnd - UrlPosStart - 9) );
LogMessage(URL1);
/// Get Name: ///
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Name := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Name);
debug_pos1:=Pos('(',Name);
if debug_pos1 >0 then
Name := Copy(Name,0,debug_pos1-1);
LogMessage(Name);
/// Get Title (for movies): ///
actPosStart := PosFrom('<a href="', HTML, EndPos); // search for url start;
actPosStart2 := PosFrom('">', HTML, actPosStart)
actPosEnd:=PosFrom('</a>', HTML, actPosStart2); // search for url end
Title := Trim(Copy(HTML, (actPosStart2 + 2), (actPosEnd - actPosStart2 - 2) ));
LogMessage(Title);
debug_pos1:=Pos('(',Title);
if debug_pos1 >0 then
Title := Copy(Title,0,debug_pos1-1);
LogMessage(Title);
/// If Original: ///
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
/// Notes: ///
actPosStart := PosFrom('<a href="', HTML, EndPos);
actPosStart2 := PosFrom('</a>', HTML, actPosStart);
Av := Trim(Copy(HTML, (actposstart2 + 5), 1));
logmessage('AV : ' + Av);
If Av = '<' then begin
actposStart2 := (actposstart2 + 5); //Step to go after "</a>"
actposstart3 := PosFrom('>', HTML, actposStart2);
actposend := PosFrom('<', HTML, actposstart3);
Notes := Trim(Copy(HTML, (actposstart3 +1), (actposend - actposStart3 - 1)));
logmessage('Notes :' + Notes);
end;
debug_pos1:=Pos('(',Notes);
if debug_pos1 >0 then
Year:= Copy(Notes,0,debug_pos1-1);
LogMessage(Notes);
/// Get Year & Note: ///
tmpYear := Copy(Notes, 0, 2);
logMessage('tmpYear :' + tmpYear);
Case tmpYear of
'c.' : Begin
Year := Copy(Notes,4,4);
Note := '';
end;
'19', '20' : Begin
If Copy(Notes,0,5) = 's' {OR Copy(Notes,0,5) = '?'} then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
If Copy(Notes,0,5) = '?' then begin
Year := Copy(Notes,0,5);
Note := Copy(Notes,7, Length(Notes)-6);
end
else begin
Year := Copy(Notes,0,4);
Note := Copy(Notes,6, Length(Notes)-5);
end;
end;
else begin
Year := '';
Note := Notes;
end;
end;
logmessage('Year :' + Year);
logmessage('Note :' + Note);
/// Get Role: ///
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));
If difpos > 0 then begin
If difpos < 200 then begin
actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
Role := StringReplace(Role, ';', ' - ', true, false, true);
Role := StringReplace(Role, '/', ' - ', true, false, true);
if Pos(', ', Role) = 1 then Delete(Role, 1, 2);
LogMessage('Role: ' + Role);
debug_pos1:=Pos('(',Role);
if debug_pos1 >0 then
Role:= Copy(Role,0,debug_pos1-1);
LogMessage(Role);
end;
end;
{AddPersonMovie(Trim(OrigT), '', '', Year, LowerCase(URL1), ctActors);} //Add movie in database
/// Total Line: ///
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;
LogMessage('LIEN :' + Lien);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
//////////
if (Lien <> '') AND (Born = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born <> '') then
AddFieldValue(pfBio, Born + #13#10 + Lien);
end;
// Photo:
curPos :=Pos('src="/actresses/id/',HTML);
if curPos > 0 then begin
EndPos := PosFrom('" width', HTML, curPos);
PhotoURL := BASE_URL + Copy(HTML, curPos + 5, EndPos - curPos - 5);
LogMessage('URL de la photo: '+ PhotoURL);
{PhotoURL := HTMLToText (PhotoURL);}
AddImageURL(4, PhotoURL);
end
else begin
PhotoURL := '';
end;
end;
In this code for this part of code script does not work:
procedure ParsePeople(URL : String; HTML : String);
///////////////////////////////////////////////////////////////////////////////////////////////////
var curpos, endpos, PosStart, PosEnd, debug_Pos1 : Integer; //
actPosstart, actposstart2, actPosStart3, actposend, UrlposStart, UrlposEnd, difPos : Integer;//
Pseudo, Born, Lien, URL1, Name, Title, Year, Av, Role, Notes, Note, tmpYear, OrigT : String;
posBorn, Country, Birthday : string;
I, counter : integer; //
///////////////////////////////////////////////////////////////////////////////////////////////////
When I replace this piece of code with this part of code script now work:
procedure ParsePeople(URL : String; HTML : String);
///////////////////////////////////////////////////////////////////////////////////////////////////
var curpos, endpos, PosStart, PosEnd, debug_Pos1 : Integer; //
actPosstart, actposstart2, actPosStart3, actposend, UrlposStart, UrlposEnd, difPos : Integer;//
Pseudo, Born, Lien, URL1, Name, Title, Year, Av, Role, Notes, Note, tmpYear, OrigT : String;
posBorn, Country, Birthday : string;
I, counter : integer;
PartBorn, PartBorn3 : Twidearray;
PartBorn2, TabCountry : twidearray;//
///////////////////////////////////////////////////////////////////////////////////////////////////
-
Countries that are currently required for TabCountry :
TabCountry := ['Austrian', 'Belgian', 'Brazilian', 'Bulgarian', 'Belarusian', 'Canadian'
, 'Cuban', 'Colombian', 'Czech', 'Dutch', 'Danish', 'English', 'Estonian'
, 'Ecuadorian', 'French', 'German', 'Greek', 'Hungarian', 'Indian'
, 'Italian', 'Kyrgyzstan', 'Latvian', 'Lithuanian', 'Maori', 'Moldovan'
, 'Netherlands', 'Norwegian', 'Portuguese', 'Polish', 'Romanian', 'Russian'
, 'Slovak', 'Spanish', 'Swiss', 'Swedish', 'Venezuelan', 'Ukrainian'
, 'Yugoslavian', 'French-Canadian', 'French (Algerian origin)'
, 'French, Moroccan origin', 'French (Moroccan origin)', 'French of Vietnamese origin'
, 'French, Vietnamese origin,', 'Russian / Kyrgyzstan', 'Yugoslavian/French'
, 'exit'];
-
I can not connect Birthday and TabCountry info data into a single, into a single piece of code to connect to the Birthplace box transferred data for the country and year of birth together.
Should look something like as attached code:
if (Birthday <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthday + ' b. ' + TabCountry[I]);
I := High(TabCountry);
or
if (Birthplace <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthplace + ' b. ' + TabCountry[I]);
I := High(TabCountry);
You can somehow arrange to make this work, nice please.
-
Thanks,
The method addfieldvaluesXml('comment', _____) works good!
Thanks for the list of country too.
For the déclaration i have forgotten to say i had declare my array PartBorn and TabCountry in global variables!
For your problem
AddFieldValue(pfBirthplace, (Birthday + 'b.' + TabCountry) ); you have forgotten ()
I'm just trying this and it works!
For country i add somes :
TabCountry := ['Austrian', 'Belgian', 'Brazilian', 'Bulgarian', 'Belarusian', 'Canadian'
, 'Chinese', 'Cuban', 'Colombian', 'Croatian', 'Cyprus', 'Czech', 'Dutch'
, 'Danish', 'English', 'Estonian', 'Ecuadorian', 'Finnish', 'French', 'German'
, 'Greek', 'Hungarian', 'Indian', 'Irish', 'Italian', 'Kyrgyzstan', 'Latvian'
, 'Lithuanian', 'Maori', 'Moldovan', 'Netherlands', 'Norwegian', 'Portuguese'
, 'Polish', 'Romanian', 'Russian', 'Slovak', 'Slovenian', 'Spanish', 'Swiss'
, 'Swedish', 'Venezuelan', 'Ukrainian', 'Yugoslavian', 'French-Canadian'
, 'French (Algerian origin)', 'French, Moroccan origin', 'French (Moroccan origin)'
, 'French of Vietnamese origin','French, Vietnamese origin,', 'Russian / Kyrgyzstan'
, 'Yugoslavian/French', 'exit'];
-
For country i add somes :
TabCountry := ['Austrian', 'Belgian', 'Brazilian', 'Bulgarian', 'Belarusian', 'Canadian'
, 'Chinese', 'Cuban', 'Colombian', 'Croatian', 'Cyprus', 'Czech', 'Dutch'
, 'Danish', 'English', 'Estonian', 'Ecuadorian', 'Finnish', 'French', 'German'
, 'Greek', 'Hungarian', 'Indian', 'Irish', 'Italian', 'Kyrgyzstan', 'Latvian'
, 'Lithuanian', 'Maori', 'Moldovan', 'Netherlands', 'Norwegian', 'Portuguese'
, 'Polish', 'Romanian', 'Russian', 'Slovak', 'Slovenian', 'Spanish', 'Swiss'
, 'Swedish', 'Venezuelan', 'Ukrainian', 'Yugoslavian', 'French-Canadian'
, 'French (Algerian origin)', 'French, Moroccan origin', 'French (Moroccan origin)'
, 'French of Vietnamese origin','French, Vietnamese origin,', 'Russian / Kyrgyzstan'
, 'Yugoslavian/French', 'exit'];
Thanks for clearing the list.
I can not connect Birthday and TabCountry info data into a single, into a single piece of code to connect to the Birthplace box transferred data for the country and year of birth together.
Should look something like as attached code:
if (Birthday <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthday + ' b. ' + TabCountry[I]);
I := High(TabCountry);
or
if (Birthplace <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthplace + ' b. ' + TabCountry[I]);
I := High(TabCountry);
You can somehow arrange to make this work, nice please.
For your problem
AddFieldValue(pfBirthplace, (Birthday + 'b.' + TabCountry) ); you have forgotten ()
I'm just trying this and it works!
Anyway I do with this part of code with your solution, we PVD always report this error:
Out of Range
so I do not know more what to do that this would still work as it should, because I almost gave up in this case.
I use the PVD version 9.9.21, what about you.
Are two redundant beauty error:
First this:
begin
AddFieldValue(pfGenre, 'EGAFD');
// URL: //
I have blocked or deleted, because there will always be one way or another display, and my opinion is that does not belong there at all.
Second this
//////////
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '----- Filmographie (EGAFD) -----' + #09;
EndPos := curPos;
Equal, this will always be displayed, and if there is a filmography or is not, so it is better so that
//////////
// BIO: //
curpos := Pos('<th>Films</th>', HTML);
LogMessage('Films readout');
if curPos > 0 then begin
Lien := '' ;
EndPos := curPos;
and not otherwise shown, because important the fact this is that when the script as final version of the script well done and it will be possible to get, or will also available via auto-update system, potential users this part of the displayed data probably they will not like.
I would ask if you can attach the full script to test it, even with my with problems associated part of the code, and see my script errors.
Thanks.
-
I can not connect Birthday and TabCountry info data into a single, into a single piece of code to connect to the Birthplace box transferred data for the country and year of birth together.
Should look something like as attached code:
if (Birthday <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthday + ' b. ' + TabCountry[I]);
I := High(TabCountry);
or
if (Birthplace <> '') AND (TabCountry[I] <> '') then
AddFieldValue(pfBirthplace, Birthplace + ' b. ' + TabCountry[I]);
I := High(TabCountry);
You can somehow arrange to make this work, nice please.
For your problem
AddFieldValue(pfBirthplace, (Birthday + 'b.' + TabCountry) ); you have forgotten ()
I'm just trying this and it works!
Anyway I do with this part of code with your solution, we PVD always report this error:
Out of Range
so I do not know more what to do that this would still work as it should, because I almost gave up in this case.
I use the PVD version 9.9.21, what about you.
I would ask if you can attach the full script to test it, even with my with problems associated part of the code, and see my script errors.
Thanks.
No more problems and frustration with this, I managed to solve this problem by using the enclosed part of the code
/// BirthDay:
ExplodeString(Born, PartBorn, #46);
If High(partBorn) > 0 then
Begin
logmessage('birhtday commence')
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If (Lowercase(partBorn[I]) = 'b') OR (Copy(partBorn[I], length(partBorn[I])-2,3) = ', b') then
BirthDay := '01/01/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If BirthDay <> '' then AddFieldValue(pfBirthday, BirthDay);
BirthDay:= StringReplace(BirthDay, '01/01/', ' b. ', true, false, true);
if Pos(', ', BirthDay) = 1 then Delete(BirthDay, 1, 2);
// Birthplace:
TabCountry := ['Austrian', 'Belgian', 'Brazilian', 'Bulgarian', 'Belarusian', 'Canadian'
, 'Chinese', 'Cuban', 'Colombian', 'Croatian', 'Cyprus', 'Czech', 'Dutch'
, 'Danish', 'English', 'Estonian', 'Ecuadorian', 'Finnish', 'French', 'German'
, 'Greek', 'Hungarian', 'Indian', 'Irish', 'Italian', 'Kyrgyzstan', 'Latvian'
, 'Lithuanian', 'Maori', 'Moldovan', 'Netherlands', 'Norwegian', 'Portuguese'
, 'Polish', 'Romanian', 'Russian', 'Slovak', 'Slovenian', 'Spanish', 'Swiss'
, 'Swedish', 'Venezuelan', 'Ukrainian', 'Yugoslavian', 'French-Canadian'
, 'French (Algerian origin)', 'French, Moroccan origin', 'French (Moroccan origin)'
, 'French of Vietnamese origin','French, Vietnamese origin,', 'Russian / Kyrgyzstan'
, 'Yugoslavian/French', 'exit'];
I := 0;
For I := Low(TabCountry) to High(Tabcountry) do
Begin
If Pos((copy(TabCountry[I], 1 ,Length(TabCountry[I])-1)),Born) > 0 then
Begin
Addfieldvalue(pfBirthPlace, (TabCountry[I] + BirthDay));
I := High(TabCountry);
end;
End;
I am very relieved now solve this problem. ::)
Now, happily to edit the script. :)
BTW:
Would be found to regulate egafd movie script that may be looking for movie titles the same way as in egafd people script .
-
Will this be something to help.
For TabBirthDay
TabBirthDay := ['1860', '1861', '1862', '1863', '1864', '1865', '1866', '1867', '1868', '1869'
, '1870', '1871', '1872', '1873', '1874', '1875', '1876', '1877', '1878', '1879'
, '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987', '1988', '1889'
, '1890', '1891', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899'
, '1900', '1901', '1902', '1903', '1904', '1905', '1906', '1907', '1908', '1909'
, '1910', '1911', '1912', '1913', '1914', '1915', '1916', '1917', '1918', '1919'
, '1920', '1921', '1922', '1923', '1924', '1925', '1926', '1927', '1928', '1929'
, '1930', '1931', '1932', '1933', '1934', '1935', '1936', '1937', '1938', '1939'
, '1940', '1941', '1942', '1943', '1944', '1945', '1946', '1947', '1948', '1949'
, '1950', '1951', '1952', '1953', '1954', '1955', '1956', '1957', '1958', '1959'
, '1960', '1961', '1962', '1963', '1964', '1965', '1966', '1967', '1968', '1969'
, '1970', '1971', '1972', '1973', '1974', '1975', '1976', '1977', '1978', '1979'
, '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987', '1988', '1989'
, '1990', '1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999'
, 'exit'];
-
For DeathDate
posBorn, Country, Birthday, DeathDate : string;
and
/// DeathDate:
ExplodeString(Born, PartBorn, #46);
If High(partBorn) > 0 then
Begin
logmessage('deathday commence')
For I := Low(partBorn) to High(partBorn) do
Begin
PartBorn[I] := Trim(partBorn[I]);
End;
For I := Low(partBorn) to High(partBorn) do
Begin
If (Lowercase(partBorn[I]) = 'd') OR (Copy(partBorn[I], length(partBorn[I])-2,3) = ', b') then
DeathDate := '28/12/' + Copy(partBorn[I+1], 0, 4);
end;
end;
If DeathDate <> '' then AddFieldValue(pfDeathDate, DeathDate);
For me it works, but incorrect.
-
I'm getting in the muddle with all versions of egafd and all correction! >:(
For this :
AddFieldValue(pfGenre, 'EGAFD');
I made this just for me, because i use iafd too and this can allow to sort more easily my list of actors.
I have the same version 9.9.21, but you resolved your problem so it's Ok;
I don't understand very well why you want to add birthday to the birthplace, the data is already in the field Birthday, if you think it's better, ok!
I'm trying to see if we can avoid adding links of movies in the filmography if the movie is already in the PVD database.
I'll see death :'( later.
I don't understand very well this :
Would be found to regulate egafd movie script that may be looking for movie titles the same way as in egafd people script .
Sorry, you should write to me like a baby :-[
-
I made this just for me, because i use iafd too and this can allow to sort more easily my list of actors.
OK, now I understand,
I don't understand very well why you want to add birthday to the birthplace, the data is already in the field Birthday, if you think it's better, ok!
This will only be with me, in the final version, which will be accessible to all, will like this
the data is already in the field Birthday
as was mentioned and it is right that such remains.
I agree, but I think you got the same opinion.
I don't understand very well this :
Would be found to regulate egafd movie script that may be looking for movie titles the same way as in egafd people script .
I wanted to say as follows:
If you have the title of the film and no other data in the PVD database that it could be the egafd movie script through the search results find the url and other info data for such a movie title.
Sorry, you should write to me like a baby
I do not understand this.
-
Ok, i understand but i'm just seeing that my fonction of search in egafd_people doesn't works now!
And with this method, the title must be exactly the same, i'm not sure that's is more simple to search directly in the site egafd, but i'll try makes search for tilte after seen my problem in egafd_people!
a baby! because my english is approximative and sometimes it could makes somes confusions or misunderstanding, so if you could be most simply possible, that's all!
-
a baby! because my english is approximative and sometimes it could makes somes confusions or misunderstanding, so if you could be most simply possible, that's all!
OK, he is best expressed in its Slovenian language, for translation into English using Google Translate.
If anything helps when I next added a reply, this also in my own language.
(Če kaj pomaga, ko bom naslednjič dodal reply,
bo ta tudi v mojem jeziku.)
-
Me, i use a dictionary!
I looked my search function and i didn't find the error!
Somes page works but if there's no 'notes' like this it not works:
http://www.egafd.com/actresses/details.php/id/n00008
The prlist is good but the script stop after have choosen a name.
I don't understand why!
I added an if pos('<th>Notes</th>', HTML) > 0 then begin in parsepeople before using this part of the page but doesn't work.
If you have an idea?
-
http://www.egafd.com/actresses/details.php/id/n00008
Works a bit slower but it works for me.
I added an if pos('<th>Notes</th>', HTML) > 0 then begin in parsepeople before using this part of the page but doesn't work.
Perhaps what this helps
//---------------------- Parse Page -------------------------
// ParsePage
// - Entrypoint for the script. Check if the search-term leads to zero, one or many results.
function ParsePage(HTML : String; URL : AnsiString) : Cardinal;
var NomTitle : string;
begin
NomTitle := '<title>' + RealName + '</title>'; //Valeur Titre dans la page de l'actrice
//Choix suivant page chargée
If Pos('<title>Actresses:', HTML) > 0 then begin //Si page index actrices
SearchResults(HTML); //Appel de la fonction recherche dans page index
Result := prList; //Résultat de la recherche
end else
If Pos('<title>Actresses:', HTML) < 0 then begin
LogMessage('Erreur...');
Result := prError; //error (actrice non trouvée)
end
else
//Page actrice
If Pos('<th>Notes</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end
else
If Pos('<th>Pseudonyms</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end
else
If Pos('<th>Films</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end else
Result := prError; //erreur (page non trouvée)
end;
//-----------------------Initialisation du script-----------------
begin
Mode := smSearch; //Mode d'initialisation du script
end.
He also added the full script for the help.
[attachment deleted by admin]
-
You're script doesn't work for me!
With what name ('title') did you make search : segaug, nicole segaud.....
Have you remove url before search?
I don't understand!
-
You're script doesn't work for me!
With what name ('title') did you make search : segaug, nicole segaud.....
Have you remove url before search?
I don't understand!
It is true that this segaug, nicole segaud..... does not work, but Nicole Segaud would like it should work. Pictures attached.
Script does not work for all or only at this address. With me this script works perfectly, no major problems with what the title might work more slowly but it works.
[attachment deleted by admin]
-
So, it's not 'Notes' who is in cause.
The name in the title must be exactly the same as in the web page for working.
But if i use Nicole Segaud, i don't obtain like your sshot2.png, a prlist, the good web page is directly get.
I don't know if it's possible to change title (putting the real name), during the script after choosing a line in the prlist and before getting web page.
I don't know if i'm clear.
-
I don't know if it's possible to change title (putting the real name), during the script after choosing a line in the prlist and before getting web page.
Not I know this may be what help you:
КиноПоиск.Ru for movie (http://www.videodb.info/download.php?ftype=1&file=kinopoisk.zip)
КиноПоиск.Ru for people (http://www.videodb.info/download.php?ftype=1&file=knopoisk_person.zip)
-
I modified SearchResults :
Before, as i declare RealName only in searchResults delete :
RealName := NomAct; (in getDownloadURL)
Montitle := ...... (in parsepage)
procedure SearchResults(HTML : string);
///////////////////////////////////////////////////////////////////////////////////////////
var curpos,endpos, counter : Integer; //
actPosStart, actPosEnd, actalposStart, actalposEnd, urlPosStart, urlposEnd : integer;//
beforeName, URLTemp, AliasName, NameTemp, RealName : string; //
///////////////////////////////////////////////////////////////////////////////////////////
Begin
//Méthode 2 Nom ou Pseudo
Curpos := Pos(nomAct, HTML);
If curpos > 0 then begin
endPos := curpos;
While (curpos > 0) AND (curpos < PosFrom('<h2 class="index">Actress:', HTML, Endpos)) do begin
endpos := curpos;
actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
NameTemp := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
LogMessage('NameTemp :' + NameTemp);
beforeName := Trim(Copy(HTML, actposStart-3, 1));
logMessage('before Name :'+ beforeName);
If copy(NameTemp,1,9) = 'alias for' then NameTemp := '';
Case NameTemp of
'' : Begin //Name in alias for ....
actPosEnd := PosFrom('href="', HTML, actPosEnd);
end;
nomAct : Begin //Same name as Title
Case BeforeName of
'c' : Begin //Real Name
RealName := NameTemp;
AliasName := NameTemp;
LogMessage('Real Name :' + RealName);
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
LogMessage('URL:' + URLTemp);
AddMoviePerson(RealName, RealName, '', Lowercase(URLTemp), ctactors);
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
end;
else begin // Good Name but Alias
AliasName := NomAct;
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalposEnd := Posfrom('</span>', HTML, actalposstart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
LogMessage('URL :' + URLTemp);
AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
end;
end;
End;
else begin
// Alias Name
actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
AliasName := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
LogMessage('Alias Name :' + AliasName);
beforeName := Trim(Copy(HTML, actposStart-3, 1));
Case beforename of
'c' : Begin // Alias is real Name
// Real Name
RealName := AliasName;
LogMessage('Real Name :' + RealName);
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
LogMessage('URL:' + URLTemp);
AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
AddSearchResult(AliasName, RealName, '', LowerCase(URLTemp),'');
end;
else begin
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalposEnd := Posfrom('</span>', HTML, actalposstart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
NameTemp := 'alias for ' + Realname;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
LogMessage('URL :' + URLTemp);
AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
end;
end;
end;
end;
curpos := PosFrom(nomAct, HTML, actPosEnd);
end;
end;
end;
It seems to work!
We can now search with part of name or part of alias name (only if the part is in good alphabetic page).
-
It seems to work!
We can now search with part of name or part of alias name (only if the part is in good alphabetic page).
That's it, now is the correct search result.
-
Merry Christmas!
Sorry, no connection since 3 days.
I noted a problem with search procedure.
Sometimes the prlist not appears and PVD get automatically one page.
For ewample if you search Natacha, the script download info of Natacha but in the egafd (N) page there are other Natacha ( Natacha [2] , Natacha [3].....), so i would like that in the prlist i can choose the good natacha.
I you have an idea why the prlist not appears?
-
Merry Christmas!
The same back.
For ewample if you search Natacha, the script download info of Natacha but in the egafd (N) page there are other Natacha ( Natacha [2] , Natacha [3].....), so i would like that in the prlist i can choose the good natacha.
I you have an idea why the prlist not appears?
With me everything is OK with the results.
Picture attached.
egafd_people (4) (Ivek23)13 script attached.
[attachment deleted by admin]
-
egafd_people (pra15)13 script attached.
[attachment deleted by admin]
-
For me not work.
The script download directly data from http://www.egafd.com/actresses/details.php/id/n00082, i have not the list
and i don't understand why.
-
For me not work.
The script download directly data from http://www.egafd.com/actresses/details.php/id/n00082, i have not the list
and i don't understand why.
I also certainly do not understand this, why not.
Tip:
If you made a backup database, then do the Restore Database, then close the PVD and then restart the PVD. This should give the result, at least for me it works, if the problem when I edit the script.
-
I found the problem,
It's not in the script but is an option on PVD who's not checked!
Preferences -> Divers (Various in english i think) -> Toujours montrer la liste sélectionnée pendant l'import d'information (always show selected list during information import)
I can now seriously works to search procedure for egafd_ movie.
I added a little thing in the beginning of parse people, in the case where your name in the title is different that the real name of a person :
// Write real Name of the web page //
Curpos := Pos('<html>',HTML);
AddFieldValue(pfTransname,(TextBetween(HTML,'<title>','</title>',False,Curpos)));
-
I changed procedure of search to more possibilities of results.
We can now obtain a result with "Segaud" for example.
I cleaned too variables who are not used.
I re-added conditions in parse people for <notes> <pseudonyms> and <Films> because i think within this, the script can give an error if for example :
there is part <notes> and there is not part <pseudonyms> in web page, in this case procedure parse page even so call parse people because 'IF pos(<notes>' is before 'IF pos(<pseudonyms' in parse page.
[attachment deleted by admin]
-
For ewample if you search Natacha, the script download info of Natacha but in the egafd (N) page there are other Natacha ( Natacha [2] , Natacha [3].....), so i would like that in the prlist i can choose the good natacha.
I you have an idea why the prlist not appears?
http://www.egafd.com/actresses/details.php/id/n00082
Otherwise work fine, now it is again a problem with this:
when I search results for Natacha PVD freezes me with your latest script, while the previous version with no problems.
This version of search results should be kept and modify it a little further and really the right solution for search results.
-
It was hard, but i found the errors.
I hope search works now.
procedure SearchResults(HTML : string);
///////////////////////////////////////////////////////////////////////////////////////////
var curpos,endpos, counter : Integer; //
actPosStart, actPosEnd, actalposStart, actalposEnd, urlPosStart, urlposEnd : integer;//
beforeName, URLTemp, AliasName, NameTemp, RealName, ifAlias : string; //
///////////////////////////////////////////////////////////////////////////////////////////
Begin
//Search Name or Pseudo or part of name (with start in same alphabetic page as RealName)
Curpos := Pos(nomAct, HTML);
If curpos > 0 then begin
endPos := curpos;
While (curpos > 0) AND (curpos < PosFrom('<h2 class="index">Actress:', HTML, Endpos)) do begin
endpos := curpos;
actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
NameTemp := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
beforeName := Trim(Copy(HTML, actposStart-3, 1));
If copy(NameTemp,1,9) = 'alias for' then
ifAlias := 'True'
else
ifAlias := '';
Case NameTemp of
nomAct : Begin //Same name as Title
//logmessage('Same Name as title');
Case BeforeName of
'c' : Begin //Real Name
RealName := NameTemp;
AliasName := NameTemp;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
LogMessage('TYPE I');
end;
else begin // Good Name but Alias
//logmessage('Good Name but Alias');
AliasName := NomAct;
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalposEnd := Posfrom('</span>', HTML, actalposstart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
// Name Temp
NameTemp := 'Alias for ' + RealName;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
LogMessage('TYPE II');
end;
end;
end;
else begin
//Alias Name
If ifAlias <> 'True' then begin
If Copy(HTML, actPosStart-1,1) <> '>' then actPosStart := PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
AliasName := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
beforeName := Trim(Copy(HTML, actposStart-3, 1));
Case beforename of
'c' : Begin // Alias is real Name
// Real Name
RealName := AliasName;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, RealName, '', LowerCase(URLTemp),'');
logmessage('TYPE III');
end;
else begin
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actPosEnd);
actalPosEnd := Posfrom('</span>', HTML, actalPosStart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
NameTemp := 'alias for ' + Realname;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
Logmessage('TYPE IV');
end;
end;
end
else begin // Name is in Alias for ......
logmessage ('trouve dans alias');
// Alias Name
actPosStart := Prevpos('"acta">', HTML, curpos);
actPosEnd := Posfrom('</a>', HTML, actPosStart);
Aliasname := Trim(Copy(HTML, (actPosStart + 7), (actPosEnd - actPosStart - 7)));
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalPosEnd := Posfrom('</span>', HTML, actalposStart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
// Get URL
urlPosStart := PrevPos('href="', HTML, actalPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
actPosEnd := PosFrom('href="', HTML, actalPosEnd);
logmessage('TYPE V');
end;
end;
end;
curpos := PosFrom(nomAct, HTML, actPosEnd);
end;
end;
end;
-
It was hard, but i found the errors.
I hope search works now.
procedure SearchResults(HTML : string);
///////////////////////////////////////////////////////////////////////////////////////////
var curpos,endpos, counter : Integer; //
actPosStart, actPosEnd, actalposStart, actalposEnd, urlPosStart, urlposEnd : integer;//
beforeName, URLTemp, AliasName, NameTemp, RealName, ifAlias : string; //
///////////////////////////////////////////////////////////////////////////////////////////
Begin
//Search Name or Pseudo or part of name (with start in same alphabetic page as RealName)
Curpos := Pos(nomAct, HTML);
If curpos > 0 then begin
endPos := curpos;
While (curpos > 0) AND (curpos < PosFrom('<h2 class="index">Actress:', HTML, Endpos)) do begin
endpos := curpos;
actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
NameTemp := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
beforeName := Trim(Copy(HTML, actposStart-3, 1));
If copy(NameTemp,1,9) = 'alias for' then
ifAlias := 'True'
else
ifAlias := '';
Case NameTemp of
nomAct : Begin //Same name as Title
//logmessage('Same Name as title');
Case BeforeName of
'c' : Begin //Real Name
RealName := NameTemp;
AliasName := NameTemp;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
LogMessage('TYPE I');
end;
else begin // Good Name but Alias
//logmessage('Good Name but Alias');
AliasName := NomAct;
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalposEnd := Posfrom('</span>', HTML, actalposstart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
// Name Temp
NameTemp := 'Alias for ' + RealName;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
LogMessage('TYPE II');
end;
end;
end;
else begin
//Alias Name
If ifAlias <> 'True' then begin
If Copy(HTML, actPosStart-1,1) <> '>' then actPosStart := PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
AliasName := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
beforeName := Trim(Copy(HTML, actposStart-3, 1));
Case beforename of
'c' : Begin // Alias is real Name
// Real Name
RealName := AliasName;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, RealName, '', LowerCase(URLTemp),'');
logmessage('TYPE III');
end;
else begin
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actPosEnd);
actalPosEnd := Posfrom('</span>', HTML, actalPosStart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
NameTemp := 'alias for ' + Realname;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
Logmessage('TYPE IV');
end;
end;
end
else begin // Name is in Alias for ......
logmessage ('trouve dans alias');
// Alias Name
actPosStart := Prevpos('"acta">', HTML, curpos);
actPosEnd := Posfrom('</a>', HTML, actPosStart);
Aliasname := Trim(Copy(HTML, (actPosStart + 7), (actPosEnd - actPosStart - 7)));
// Real Name
actalPosStart := Posfrom('alias for ', HTML, actposEnd);
actalPosEnd := Posfrom('</span>', HTML, actalposStart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
// Get URL
urlPosStart := PrevPos('href="', HTML, actalPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
actPosEnd := PosFrom('href="', HTML, actalPosEnd);
logmessage('TYPE V');
end;
end;
end;
curpos := PosFrom(nomAct, HTML, actPosEnd);
end;
end;
end;
For Natacha I tried this and now it works.
Thank you.
Probably tomorrow, followed by some corrections and additions to the script.
-
Here is a promise:
Added:
- I fixed a small bug in the Born.
- Added correction Birthday for better search years.
- Added correction DeathDate for better search years.
- Added link to Web Sites.
- Added link to the Internet Clubs and Groups.
- Both together for data transfer in Comment (Komentarji) field.Pictures attached.
- Corrected the following in Bio (part of this added code below).
//if (Lien <> '') AND (Born = '') then
//AddFieldValue(pfBio, Lien);
//if (Lien <> '') AND (Born <> '') then
//AddFieldValue(pfBio, Born + #13#10 + Lien);
if (Lien <> '') AND (Born2 = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born2 <> '') then
AddFieldValue(pfBio, Born2 + #13#10 + Lien);
end;
Deleted:
- In TabCountry removed Chinese and Greek due to incorrect data
The reason why I do the following:
An example of Chinese:
Chinese tattoo ---> incorrect Chinese the Birthplace
An example of Greek:
Green ---> incorrect in Greek the Birthplace
Proper two should not be recorded the Birthplace.
egafd_people (4)(Ivek23)14 script attached
[attachment deleted by admin]
-
Thank you, i'll see that, i'm working in search procedure in egafd_movie!
-
Thank you, i'll see that, i'm working in search procedure in egafd_movie!
Thanks, I look forward to the results of the work.
-
- Corrected link to Web Sites and Internet Clubs and Groups.
The code is now as follows:
end; /////----- End of infos in <Films>
//if (Lien <> '') AND (Born = '') then
//AddFieldValue(pfBio, Lien);
//if (Lien <> '') AND (Born <> '') then
//AddFieldValue(pfBio, Born + #13#10 + Lien);
if (Lien <> '') AND (Born2 = '') then
AddFieldValue(pfBio, Lien);
if (Lien <> '') AND (Born2 <> '') then
AddFieldValue(pfBio, Born2 + #13#10 + Lien);
end;
/////----- Infos in <Web Sites>
If Pos('<th>Films</th>', HTML) > 0 then begin
// WEB SITES: //
curpos := Pos('<th>Web Sites</th>', HTML);
LogMessage('Web Sites readout');
if curPos > 0 then begin
Sites := ' • • Web Sites • • ';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('<p class="cpyrgt" align="center">', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If Sites <> '' then
Sites := Sites + #13;
If URL1 <> '' then
Sites := Sites + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage('WEB SITES :' + Sites);
curPos := PosFrom('<a href="', HTML, actPosEnd);
end;
end; /////----- End of infos in <Web Sites>
If Sites <> '' then
//AddFieldValueXML('comment', Sites);
LogMessage('WEB SITES :' + Sites);
fullinfo:= fullinfo + Sites + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
/////----- Infos in <Internet Clubs and Groups>
If Pos('<th>Internet Clubs and Groups</th>', HTML) > 0 then begin
// CLUB AND GROUPS: //
curpos := Pos('<th>Internet Clubs and Groups</th>', HTML);
LogMessage('Internet Clubs and Groups readout');
if curPos > 0 then begin
Sites1 := ' • • Internet Clubs and Groups: • •';
If Sites1 <> '' then
Sites1 := Sites1;
LogMessage('CLUB AND GROUPS :' + Sites1);
If Sites1 <> '' then
//AddFieldValueXML('comment', Sites1);
LogMessage('CLUB AND GROUPS :' + Sites1);
fullinfo:= fullinfo + #13 + Sites1 + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
end; /////----- End of infos in <Internet Clubs and Groups>
/////----- Infos in <Bomis Rings>
If Pos('<li>Bomis Rings:</li>', HTML) > 0 then begin
// BOMIS: //
curpos := Pos('<li>Bomis Rings:</li>', HTML);
LogMessage('Bomis Rings readout');
if curPos > 0 then begin
Bomis := ' • Bomis •';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If Bomis <> '' then
Bomis := Bomis + #13;
If URL1 <> '' then
Bomis := Bomis + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage('BOMIS :' + Bomis);
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
end;
end; /////----- End of infos in <Bomis Rings>
If Bomis <> '' then
//AddFieldValueXML('comment', Bomis);
LogMessage('BOMIS :' + Bomis);
fullinfo:= fullinfo + Bomis + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
/////----- Infos in <MSN Groups>
If Pos('<li>MSN Groups:</li>', HTML) > 0 then begin
// MSN: //
curpos := Pos('<li>MSN Groups:</li>', HTML);
LogMessage('MSN Groups readout');
if curPos > 0 then begin
MSN := ' • MSN •';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If MSN <> '' then
MSN := MSN + #13;
If URL1 <> '' then
MSN := MSN + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage ('MSN :' + MSN);
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
end;
end; /////----- End of infos in <MSN Groups>
If MSN <> '' then
//AddFieldValueXML('comment', MSN);
LogMessage('MSN :' + MSN);
fullinfo:= fullinfo + MSN + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
/////----- Infos in <MySpace>
If Pos('<li>MySpace:</li>', HTML) > 0 then begin
// MYSPACE: //
curpos := Pos('<li>MySpace:</li>', HTML);
LogMessage('MySpace readout');
if curPos > 0 then begin
MySpace := ' • MySpace •';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If MySpace <> '' then
MySpace := MySpace + #13;
If URL1 <> '' then
MySpace := MySpace + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage('MYSPACE :' + MySpace);
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
end;
end; /////----- End of infos in <MySpace>
If MySpace <> '' then
//AddFieldValueXML('comment', MySpace);
LogMessage('MYSPACE :' + MySpace);
fullinfo:= fullinfo + MySpace + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
/////----- Infos in <Wikipedia>
If Pos('<li>Wikipedia:</li>', HTML) > 0 then begin
// WIKIPEDIA: //
curpos := Pos('<li>Wikipedia:</li>', HTML);
LogMessage('Wikipedia readout');
if curPos > 0 then begin
Wikipedia := ' • Wikipedia •';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If Wikipedia <> '' then
Wikipedia := Wikipedia + #13;
If URL1 <> '' then
Wikipedia := Wikipedia + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage('WIKIPEDIA :' + Wikipedia);
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
end;
end; /////----- End of infos in <Wikipedia>
If Wikipedia <> '' then
//AddFieldValueXML('comment', Wikipedia);
LogMessage('WIKIPEDIA :' + Wikipedia);
fullinfo:= fullinfo + Wikipedia + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
/////----- Infos in <Yahoo! Groups>
If Pos('<li>Yahoo! Groups:</li>', HTML) > 0 then begin
// YAHOO: //
curpos := Pos('<li>Yahoo! Groups:</li>', HTML);
LogMessage('Yahoo! Groups readout');
if curPos > 0 then begin
Yahoo := #10 + ' • Yahoo! Groups •';
endPos := curPos;
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
while (curPos > 0) AND (curPos < PosFrom('</ul>', HTML, endPos)) do begin
curPos := curPos + Length('<a class="lnk" target="_new" href="');
endPos := PosFrom('">', HTML, curPos);
URL1 := Copy(HTML, curPos, endPos - curPos);
URL1 := BASE_URL + URL1;
curPos := endPos + 2;
endPos := PosFrom('</a></li>', HTML, curPos);
Name := Copy(HTML, curPos, endPos - curPos);
/// Total Line: ///
If Yahoo <> '' then
Yahoo := Yahoo + #13;
If URL1 <> '' then
Yahoo := Yahoo + '<link url="' + URL1 + '">' + Name + '</link>';
LogMessage('YAHOO :' + Yahoo);
curPos := PosFrom('<a class="lnk" target="_new" href="', HTML, curPos);
end;
end; /////----- End of infos in <Yahoo! Groups>
If Yahoo <> '' then
//AddFieldValueXML('comment', Yahoo);
LogMessage('YAHOO :' + Yahoo);
fullinfo:= fullinfo + Yahoo + #13;
LogMessage(fullinfo);
//AddFieldValueXML('comment', fullinfo);
end;
AddFieldValueXML('comment', fullinfo);
// Photo:
curPos :=Pos('src="/actresses/id/',HTML);
if curPos > 0 then begin
EndPos := PosFrom('" width', HTML, curPos);
PhotoURL := BASE_URL + Copy(HTML, curPos + 5, EndPos - curPos - 5);
LogMessage('URL de la photo: '+ PhotoURL);
{PhotoURL := HTMLToText (PhotoURL);}
AddImageURL(4, PhotoURL);
end
else begin
PhotoURL := '';
end;
end;
-
Here egafd_Movie with search procedure.
I change a little :
If no result in the actual page (first letter alphabetic), prlist show others alphabetic pages for choice an other page.
I use two different searching sentence, the complete Title or a combination of the two first words of the title (we can improve more possibilities easily later).
For example :
Title = The Starter ====> The script search : 'the stater' and 'starter'
Title = The Young Starter =====> 'the young starter' and 'young'
Title = Starter, The ======> 'the starter' and 'starter' (if option in PVD place The in the end)
I made some test and it seems to work but.....
False there are bugs,
First change in GetDownloadUrl :
firstStr := LowerCase(Copy(nMovie, 1, (Length(nMovie)-(Length(nMovie)-1))));
and
//Search:
I:= 0;
While (I < nSearch) AND (ifFind = 0) do Begin
logMessage ('while commence');
[attachment deleted by admin]
-
Already added the aforementioned changes.
egafd_people (pra15)15 script added
[attachment deleted by admin]
-
I added notes in prList and changed somes errors in search procedure. (egafd_movie)
[attachment deleted by admin]
-
egafd_movie
egafd_Movie(12) script
Added:
- Corrected bug in the code of Director.
- Added full transfer of data to Director in Comment field.
- The Bio I fixed a small error in Role code.
- Added a version and name of the script.
Deleted:
- Blocked the transfer of all data for Director in field Director, transfer only the first director of the list.
The reason why I do the following:
For Director:
When the Director is now displayed only the first director now, because otherwise the People section you can not find information for example, such associations in Director Title:
- Alessandro Perrella as Alex Perry
- Alessandro Perrella aas Alex Perry
- Alessandro Perrella / Alex Perry
- Alessandro Perrella, Alex Perry
- Alessandro Perrella and Alex Perry
egafd_Movie(12) script attached
[attachment deleted by admin]
-
egafd_movie
egafd_mod12 script
Added:
- Corrected bug in the code of Director.
- Added full transfer of data to Director in Comment field.
- The Bio I fixed a small error in Role code.
- Added a version and name of the script.
- Added Notes.
- Added Suppliers.
Deleted:
- Blocked the transfer of all data for Director in field Director, transfer only the first director of the list.
The reason why I do the following:
For Director:
When the Director is now displayed only the first director now, because otherwise the People section you can not find information for example, such associations in Director Title:
- Alessandro Perrella as Alex Perry
- Alessandro Perrella aas Alex Perry
- Alessandro Perrella / Alex Perry
- Alessandro Perrella, Alex Perry
- Alessandro Perrella and Alex Perry
egafd_mod12 script attached
[attachment deleted by admin]
-
egafd_movie
Small change:
//Director
dbgstrg := '';
curPos := Pos('<td valign="top">Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '<td valign="top">Director: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
If dbgstrg <> '' then
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ' + 'Directors: ' + dbgstrg)
else
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ');
debug_pos1:=Pos('(',dbgstrg) OR Pos(', ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' as ',dbgstrg) OR Pos(' aas ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('/',dbgstrg) OR Pos(' and ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
-
Thank you and happy new year at all!
-
Thank you
Welcome.
happy new year at all!
The same other users.
-
egafd_movie
For prList :
Corrected search results for part of the code for alias Name,
end
else begin // Name is in Alternative title for ......
// Alias Name
actPosStart := Prevpos('"flma">', HTML, curpos);
actPosEnd := Posfrom('</a>', HTML, actPosStart);
Aliasname := Trim(Copy(HTML, (actPosStart + 7), (actPosEnd - actPosStart - 7)));
Logmessage('AliasName: '+ AliasName);
// Real Name
where the missing first letter in the mail (not was) for alternative Movie title.
Now is OK.
Whole prList code:
//---------- Procedure SearchResults ----------//
// Create list of movies found during the search
procedure SearchResults (HTML : String);
Var
URLXPage, URLTemp, NameTemp, BeforeName, ifAlias, AliasName, RealName, firstStr2, noteSearch : String;
TabPartTitle, TabNoteSearch : TwideArray;
TabPartSearch : Array[0..1] of string;
nSearch, ifFind, actPosStart, actPosEnd, URLPosStart, URLPosEnd, notPosStart, notPosEnd : Integer;
CurPos, endPos, actalPosStart, actalPosEnd, TypPVD : Integer;
essai : string;
Begin
ifFind := 0; //Initialisation variable
// Separate parts of title :
If Pos(#32,nMovie) = 0 then begin
nSearch := 1;
TabPartSearch[0] := nMovie;
end
else begin
ExplodeString(nMovie,TabPartTitle,#32);
// Case where option in PVD is 'Title, the' :
If Copy(TabPartTitle[High(TabPartTitle)-1],Length(TabPartTitle[High(TabPartTitle)-1]),1) = ',' then begin
TypPVD := 1;
TabPartTitle[High(TabpartTitle)-1] := Copy(TabPartTitle[High(TabpartTitle)-1], 1, Length(TabpartTitle[High(TabpartTitle)-1])-1);
For I := Low(TabPartTitle) to (High(TabPartTitle)-1) do
Begin
nMovie := '';
If I = 0 then begin
nMovie := TabpartTitle[I];
end
else begin
nMovie := nMovie + #32 + TabPartTitle[I];
end;
end;
nMovie := TabPartTitle[High(TabPartTitle)] + #32 + nMovie;
LogMessage(nMovie);
firstStr2 := LowerCase(Copy(TabPartTitle[High(TabPartTitle)], 1 ,1));
end
else begin
TypPVD := 0;
FirstStr2 := LowerCase(Copy(TabPartTitle[1],1,1));
end;
For I := Low(TabPartTitle) to High(TabPartTitle) do
Begin
TabPartTitle[I] := Lowercase(TabPartTitle[I]);
end;
// Second value to search :
TabPartSearch [0] := LowerCase(nMovie);
nSearch := 1;
If High(TabPartTitle) > 0 then begin
If Length(TabPartTitle[0]) > 3 then begin
TabPartSearch [1] := TabPartTitle[0];
nSearch := 2;
end
else
If (Length(TabPartTitle[0]) < 4) AND (Length(TabPartTitle[1]) > 3) then begin
TabPartSearch [1] := TabPartTitle[1];
nSearch := 2;
end
else begin
TabPartSearch [1] := TabPartTitle[0] + #32 + TabPartTitle[1];
nSearch := 2;
end;
LogMessage('Second search : ' + TabPartSearch[1]);
end;
LogMessage ('nSearch' + IntToStr(nSearch));
end;
//Search:
I:= 0;
While (I < nSearch) AND (ifFind = 0) do Begin
logMessage ('while commence');
Curpos := Pos(TabPartSearch[I], HTML);
If curpos > 0 then begin
endPos := curpos;
While (curpos > 0) AND (curpos < PosFrom('<h2 class="index">Films:', HTML, Endpos)) do begin
endpos := curpos;
actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
NameTemp := LowerCase(Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1))));
LogMessage ('NameTemp: '+ NameTemp);
LogMessage ('nmovie: '+ nMovie);
beforeName := Trim(Copy(HTML, actposStart-3, 1));
If copy(NameTemp,1,21) = 'alternative title for' then
ifAlias := 'True'
else
ifAlias := '';
Case NameTemp of
nMovie : Begin //Same name as Title
//logmessage('Same Movie as title');
Case BeforeName of
'l' : Begin //Real Name
RealName := NameTemp;
AliasName := NameTemp;
//Notes
notPosStart := Posfrom('/a>', HTML, Curpos);
essai := copy(HTML, notPosStart+3,1);
LogMessage('essai: ' + essai);
If copy(HTML, notPosStart+3,1) = #32 then begin
logmessage('if begin');
notPosStart := PosFrom('class="notes">', HTML, notPosstart)+14;
notPosEnd := PosFrom('</i>', HTML, notPosStart);
noteSearch := Trim(Copy(HTML, notPosStart, (notPosEnd-notPosStart)));
logmessage(notesearch);
end
else begin
noteSearch := '';
end;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NoteSearch, '', LowerCase(URLTemp),'');
actPosEnd := PosFrom('href="', HTML, urlPosEnd);
ifFind := 1;
LogMessage('TYPE I: Same Title as original movie');
end;
else begin // Good Name but Alternative title
//logmessage('Good Name but Alias');
AliasName := nMovie;
// Real Name
actalPosStart := Posfrom('alternative title for ', HTML, actposEnd);
actalposEnd := Posfrom('</span>', HTML, actalposstart);
RealName := Trim(Copy(HTML, (actalposStart + 22), (actalposEnd - actalposStart - 22)));
// Name Temp
NameTemp := 'Alternative title for ' + RealName;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
actPosEnd := PosFrom('href="', HTML, urlPosEnd);
ifFind := 1;
LogMessage('TYPE II: Same Title as an alternative title of a Movie');
end;
end;
end;
else begin
//Part of Name
If ifAlias <> 'True' then begin
If Copy(HTML, actPosStart-1,1) <> '>' then actPosStart := PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
AliasName := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
beforeName := Trim(Copy(HTML, actposStart-3, 1));
Case beforename of
'l' : Begin // Title is a part of a real Movie
// Real Name
RealName := AliasName;
logmessage(Realname);
logmessage(AliasName);
//Notes
notPosStart := Posfrom('/a>', HTML, Curpos);
essai := copy(HTML, notPosStart+3,1);
LogMessage('essai: ' + essai);
If copy(HTML, notPosStart+3,1) = #32 then begin
logmessage('if begin');
notPosStart := PosFrom('class="notes">', HTML, notPosstart)+14;
notPosEnd := PosFrom('</i>', HTML, notPosStart);
noteSearch := Trim(Copy(HTML, notPosStart, (notPosEnd-notPosStart)));
logmessage(notesearch);
end
else begin
noteSearch := '';
end;
// Get URL
urlPosStart := Prevpos('href="', HTML, actposStart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
logmessage(URLTemp);
AddSearchResult(RealName, NoteSearch, '', LowerCase(URLTemp),'');
ifFind := 1;
actPosEnd := PosFrom('href="', HTML, urlPosEnd);
logmessage('TYPE III: Part of a Real Name');
end;
else begin
// Real Name
actalPosStart := Posfrom('alternative title for ', HTML, actPosEnd);
actalPosEnd := Posfrom('</span>', HTML, actalPosStart);
RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
NameTemp := 'alternative title for ' + Realname;
// Get URL
urlPosStart := PrevPos('href="', HTML, actPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
actPosEnd := PosFrom('href="', HTML, actalPosEnd);
ifFind := 1;
Logmessage('TYPE IV: Part of an alternative Name');
end;
end;
end
else begin // Name is in Alternative title for ......
// Alias Name
actPosStart := Prevpos('"flma">', HTML, curpos);
actPosEnd := Posfrom('</a>', HTML, actPosStart);
Aliasname := Trim(Copy(HTML, (actPosStart + 7), (actPosEnd - actPosStart - 7)));
Logmessage('AliasName: '+ AliasName);
// Real Name
actalPosStart := Posfrom('alternative title for ', HTML, actposEnd);
actalPosEnd := Posfrom('</span>', HTML, actalposStart);
RealName := Trim(Copy(HTML, (actalposStart + 22), (actalposEnd - actalposStart - 22)));
LogMessage('RealName: '+ RealName);
// Get URL
urlPosStart := PrevPos('href="', HTML, actalPosstart);
urlPosend := PosFrom('" class="', HTML, urlPosstart);
URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
ifFind := 1;
actPosEnd := PosFrom('href="', HTML, urlPosEnd);
logmessage('TYPE V: Part find in alternative title for...');
end;
end;
end;
curpos := PosFrom(TabPartSearch[I], HTML, actPosEnd);
end;
end;
I := I + 1;
end; // End first while
// Add others alphabetics page in prList (who had not seen) if no result in actual page:
If (ifFind = 0) then begin
ShowMessage('Try to find movie in another alphabetic page!', 'MOVIE NOT FIND IN THIS PAGE :');
For A := Low(TabSeenXPage) to High(TabSeenXPage) do
Begin
If TabSeenXPage[A] = '0' then begin
URLXPage := 'http://www.egafd.com/films/index.php/index/' + TabXPage[A];
AddSearchResult('Search in Alphabetic page',UpperCase(TabXPage[A]),'', URLXPage,'');
end;
end;
end
else begin
CurPos := Pos('<title>Films: ', HTML);
If (Copy(URLSearch, Length(URLSearch), 1)) = (LowerCase(Copy(HTML,Curpos+14,1))) then begin
URLXPage := 'http://www.egafd.com/films/index.php/index/' + firstStr2;
AddSearchResult('Search in Alphabetic page',UpperCase(firstStr2),'', URLXPage,'');
end;
end;
end;
//---------- PARSE PAGE ----------//
-
egafd_movie
Small change for Director:
egafd_movie
The reason why I do the following:
For Director:
When the Director is now displayed only the first director now, because otherwise the People section you can not find information for example, such associations in Director Title:
- Alessandro Perrella as Alex Perry
- Alessandro Perrella aas Alex Perry
- Alessandro Perrella / Alex Perry
- Alessandro Perrella, Alex Perry
- Alessandro Perrella and Alex Perry
//Director
dbgstrg := '';
curPos := Pos('<td valign="top">Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '<td valign="top">Director: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
If dbgstrg <> '' then
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ' + 'Directors: ' + dbgstrg)
else
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ');
debug_pos1:=Pos('(',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(', ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' as ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' aas ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('/',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' and ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
-
Thank you!
Do you think we must add more style of search sentence (with 3 words for example) or this is not necessary.
-
Thank you!
Do you think we must add more style of search sentence (with 3 words for example) or this is not necessary.
If the search results will certainly be better than it is in force until now, of course, and therefore more effective search movie titles, definitely yes, yes, this also makes.
We'll see where this is a test of how it works.
-
egafd_movie
Small change for Year:
I have found and corrected a small error in the Year code.
///// Part <Details> :
If Pos('<th>Details</th>', HTML) > 0 then begin
//Year
dbgstrg := '';
CurPos := Pos('<td valign="top">Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '<td valign="top">Released: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('s',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfYear,dbgstrg);
//Director
-
egafd_movie
Small change for Notes:
For security reasons, I fixed a piece of code in the Notes code.
//Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
end; //// End of Part <Details>
-
egafd_movie
Complete Details Code:
///// Part <Details> :
If Pos('<th>Details</th>', HTML) > 0 then begin
//Year
//pull ~Year~ from Part 'Details'
dbgstrg := '';
CurPos := Pos('<td valign="top">Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '<td valign="top">Released: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('s',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfYear,dbgstrg);
//Director
//pull ~Director~ from Part 'Details'
dbgstrg := '';
curPos := Pos('<td valign="top">Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '<td valign="top">Director: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
If dbgstrg <> '' then
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ' + 'Directors: ' + dbgstrg)
else
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ');
debug_pos1:=Pos('(',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(', ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' as ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' aas ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('/',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' and ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('or ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
//Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
end; //// End of Part <Details>
-
egafd_movie
Added previously mentioned changes.
egafd_mod13 script attached
[attachment deleted by admin]
-
egafd_movie
Small change for Notes:
Added Duration.
//Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
//pull ~Duration~ from 'Details'
//Duration
curpos := Pos('<td valign="top">Notes: ' , HTML);
LogMessage('getting durations')
actPosEnd := PosFrom(' mins', HTML, actPosStart);
actPosStart := actPosEnd - 3;
Tmp := IntToStr(StrToInt(Copy(HTML, actPosStart, 3)));
LogMessage('Duration: ' + Tmp);
if Tmp = '0' then Tmp := '';
If Tmp <> '' then AddFieldValue(mfDuration, Tmp);
if Tmp = '' then Tmp := 'duration unknown';
LogMessage(' Parsing: ' + Tmp);
end; //// End of Part <Details>
-
egafd_movie
Small change for Notes:
Added Duration.
//Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
//pull ~Duration~ from 'Details'
//Duration
curpos := Pos('<td valign="top">Notes: ' , HTML);
LogMessage('getting durations')
actPosEnd := PosFrom(' mins', HTML, actPosStart);
actPosStart := actPosEnd - 3;
Tmp := IntToStr(StrToInt(Copy(HTML, actPosStart, 3)));
LogMessage('Duration: ' + Tmp);
if Tmp = '0' then Tmp := '';
If Tmp <> '' then AddFieldValue(mfDuration, Tmp);
if Tmp = '' then Tmp := 'duration unknown';
LogMessage(' Parsing: ' + Tmp);
end; //// End of Part <Details>
It works properly only if the length of the movie displayed in minutes (for example: 90 mins, 114 mins ...).
-
egafd_movie
egafd_mod13(1)
Added:
- Added full transfer of data to Director in Comment field.
- Added full transfer of data to Countries in Country field.
- Added full transfer of data to Studio in Studio field.
- Added full transfer of data to Tags(Alternate Titles) in Comment field.
- Added a version and name of the script.
egafd_mod13(1) script attached
egafd_movie
egafd_mod13(2)
Added:
- Added full transfer of data to Director in Comment field.
- Added full transfer of data to Countries in Country field.
- Added full transfer of data to Studio in Studio field.
- Added full transfer of data to Tags(Alternate Titles) in Comment field.
- Added a version and name of the script.
egafd_mod13(2) script attached
[attachment deleted by admin]
-
I think the time has come when we can say that we have come to the final version egafd_movie script, which will be published also for other users as well as the publication via system for automatic updates.
Here now is the egafd_movie script (Release Candidate), which is also attached.
[attachment deleted by admin]
-
I think the time has come when we can say that we have come to the final version egafd_people script, which will be published also for other users as well as the publication via system for automatic updates.
Here now is the egafd_people script (Release Candidate), which is also attached.
[attachment deleted by admin]
-
Of course, if you agree pra15 , then I'll opened a new topic specifically for egafd_movie script and egafd_people script and there published the final version of the script with all the necessary descriptions that go with them, and I will also edited by for the part that this script will also be available through system for automatically updated.
-
Hello, sorry i'm not at home, i think i 'll go back the next week end.
But you can post the final script, i can't see it for the moment but no problem and thanks a lot for your works.
-
Hello, sorry i'm not at home, i think i 'll go back the next week end.
But you can post the final script, i can't see it for the moment but no problem and thanks a lot for your works.
OK I will, but first I'll do some tests to make sure that everything is really okay and formalities before Post final Scripts.
-
egafd_movie final
Now here is the final version of the egafd_movie script
Added:
- I added a link to download information to a custom field for
- EGAFD Version
- EGAFD ID
- Director
- AKA
- Edited by function OPTIONS.
- Corrections and additions to the ParseMovie
- Corrections and additions to the Aka
CUSTOM FIELD USE:
EGAFD data: PVD field: Type:
------------- -------------- -----------------
EGAFD Version ~EGAFD Version~ short text
EGAFD ID ~EGAFD ID~ short text
Director ~EGAFD Director~ memo
AKA ~EGAFD FullAkas~ memo
//OPTIONS
//For Example, Not Work:
GET_THEMES = True; //Set to False if you do not want Themes in Category field
//For Example, Not Work
GET_REVIEW = True; //For Example, Not Work
GET_CREDITS = True; //For Example, Not Work
//Work:
GET_DIRECTOR = True; //Set to True if you do want to DIRECTOR in Comment field OR
//False if you do not want to DIRECTOR in Comment field
GET_AKAS = True; //Set to True if you do want to FullAKAS information in Comment field OR
//False if you do not want to FullAKAS information in Comment field
GET_EGAFD = True; //Set to True if you do want to EGAFD in Comment field OR
//False if you do not want to EGAFD in Comment field
GET_EGAFD_ID = False; //Set to True if you do want to EGAFD_ID in Comment field OR
//False if you do not want to EGAFD_ID in Comment field
GET_COMMENT = True; //Set to True if you do want to COMMENT in Comment field OR
//False if you do not want to COMMENT in Comment field
egafd_movie(final) script attached
[attachment deleted by admin]
-
egafd_people final
Now here is the final version of the egafd_people script
Added:
- Edited by function OPTIONS.
- Corrections and additions to the ParsePeople
//OPTIONS
//For Example, Not Work:
GET_THEMES = True; //Set to False if you do not want Themes in Category field
//For Example, Not Work
GET_REVIEW = True; //For Example, Not Work
GET_CREDITS = True; //For Example, Not Work
//Work:
GET_PRA15 = False; //Set to True if you do want EGAFD in Genre field OR
//Set to False if you do not want EGAFD in Genre field
GET_TRANSNAME = False;
//Set to True if you do want TRANSNAME in Transname field OR
//Set to False if you do not want TRANSNAME in Transname field
GET_ROLE = False; //Set to True if you do want to ROLE in Filmography field OR
//False if you do not want ROLE in Filmography field
GET_PERSONMOVIE = False;
//Set to True if you do want to add PERSONMOVIE in Filmography field OR
//False if you do not want to add PERSONMOVIE in Filmography field
GET_PERSONMOVIEROLE = False;
//Set to True if you do want to add PERSONMOVIEROLE in Filmography field OR
//False if you do not want to add PERSONMOVIEROLE in Filmography field
GET_FULLINFO = True; //Set to True if you do want to COMMENT in Comment field OR
//False if you do not want to COMMENT in Comment field
GET_COMMENT = True; //Set to True if you do want to COMMENT in Comment field OR
//False if you do not want to COMMENT in Comment field
egafd_people(final) script attached
[attachment deleted by admin]
-
Egafd_movie script
This script has now been released and is available via the program's auto-update system.
Run Help > Check for updates and choose Egafd movie from the list.
Notice:
Post any comments or questions to the Egafd movie script. (http://www.videodb.info/forum_en/index.php/topic,3071.0.html)
Egafd_people script
This script has now been released and is available via the program's auto-update system.
Run Help > Check for updates and choose Egafd people from the list.
Notice:
Post any comments or questions to the Egafd people script. (http://www.videodb.info/forum_en/index.php/topic,3072.0.html)
BTW:
Please be locked topic!
Thank you.