English > Development
Script for egafd.com
Ivek23:
For egafd.psf
--- Code: ---//Notes
curpos := Pos('Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
AddFieldValue(mfDescription, dbgstrg);
--- End code ---
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]
pra15:
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?
Ivek23:
--- Quote ---I try <Link="www......">Name</Link> but when i click in, nothing happens!
--- End quote ---
--- Code: ---<Link="www......">Name</Link>
--- End code ---
This is wrong (not correct), so can not work.
Try something like the following
--- Code: ---'<link url="' + PeopleURL + '">' + Name + '</link>'
--- End code ---
or is this
--- Code: ---'<link url="' + MovieURL + '">' + Title + '</link>'
--- End code ---
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.
Ivek23:
--- Code: ---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);
--- End code ---
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.
pra15:
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version