English > Scripts and Templates

AllMovie script for People:Questions

(1/3) > >>

Ivek23:
The AllMovie site has been replaced by AllRovi.



--- Quote ---I wonder if it was possible script for AllMovie People Information.
--- End quote ---

I'm working on AllMovie script for People However, I wonder how such data Birthday in box Birthday shifted into the Comments field,is at all possible because the Person information is not yet the custom fields.

Ivek23:

--- Quote from: Ivek23 on March 15, 2011, 09:55:00 am ---
--- Quote ---I wonder if it was possible script for AllMovie People Information.
--- End quote ---

I'm working on AllMovie script for People However, I wonder how such data Birthday in box Birthday shifted into the Comments field,is at all possible because the Person information is not yet the custom fields.

--- End quote ---

Obviously it will be necessary to wait for the PVD version 1. xxx and in the future to complete renovation and improvements in Sections PVD Information for People(It has also Nostra some mention somewhere in the forum).

Ivek23:
Here is the test and conversion script AllMovie People -Ivek23- Information for People.

Welcome comments and opinions on the script.

---------------------

Appendix attached:
I'm just little changed and corrected for another script attached to a larger size.

[attachment deleted by admin]

Ivek23:
I have a question:

How this code


--- Code: ---function RemoveTagsEx(AText : String) : String;
var
 B, E : Integer;
begin
 Result := AText;

 B := PosFrom('<', Result, 1);
 E := PosFrom('>', Result, B);

 while (B > 0) AND (B < E) do begin
  Delete(Result, B, E - B + 1);

  B := Pos('<', Result);
  E := Pos('>', Result);
 end;
end;

procedure ParseBiography(HTML : String);
var
 curPos, endPos : Integer;
 TmpStr, TmpStr1, TmpStr2 : String;
begin
 curPos := Pos('<div id="results-table">', HTML);
 endPos := curPos
 if curPos < 1 then
  Exit;
   
 //Biography
 curPos := PosFrom('<td colspan="2">', HTML, curPos);
 endPos := PosFrom('</p></td>', HTML, curPos);
 TmpStr := Copy(HTML, curPos, EndPos - curPos);
 TmpStr1 := StringReplace(TmpStr, ' -- ', '—', True, True, False);
 TmpStr2 := StringReplace(TmpStr1, ' --- ', '—', True, True, False);
 TmpStr := StringReplace(TmpStr2, '--', '—', True, True, False);
 TmpStr1 := StringReplace(TmpStr, #13#13#13#13, #13#10#13#10, True, True, False);
 TmpStr2 := RemoveTagsEx(TmpStr1);
 AddFieldValue(pfBio, TmpStr2);
 end;

--- End code ---

and this code


--- Code: ---procedure ParseFilmography(HTML : String);
var
 curPos, EndPos : Integer;
 TmpStr : String;
 Name, Role, URL : String;
begin
 curPos := Pos('<div id="results-table">', HTML);
 if curPos < 1 then
  Exit;
 
 LogMessage('Pasrsing filmography...');
 
 TmpStr := '';
 
 EndPos := curPos;
 curPos := PosFrom('http://www.allmovie.com/work/', 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('<td>', HTML, EndPos);
  if curPos > 0 then begin
   curPos := curPos + 4;
   EndPos := PosFrom('</td>', HTML, curPos);
   
   Role := Trim(Copy(HTML, curPos, EndPos - curPos));
  end else begin
   Role := ''; 
   curPos := EndPos;
  end;
   
  AddMoviePerson(Name, '', Role, 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.allmovie.com/work/', HTML, curPos)
  else
   Exit; 
 end;
 
 AddFieldValue(pfFilmography, TmpStr);
end;

--- End code ---

combine the information in the field pfBio (Biography).

Thanks for the help.

Ivek23:
For assistance:
For example, people url

http://www.allmovie.com/artist/george-gabby-hayes-31223

http://www.allmovie.com/artist/geoffrey-rush-151418

http://www.allmovie.com/artist/geoffrey-lewis-42203

http://www.allmovie.com/artist/gene-wilder-116771

Added a script to facilitate assistance.

If this change
this AddFieldValue(pfFilmography, TmpStr);
in this
AddFieldValue(pfBio, TmpStr);
I just transferred filmography but not a biography.

---------------------

Appendix attached:
I'm just little changed and corrected for another script attached to a larger size.


[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version