Personal Video Database

English => Development => Scripts and Templates => Topic started by: Ivek23 on March 15, 2011, 09:55:00 am

Title: AllMovie script for People:Questions
Post by: Ivek23 on March 15, 2011, 09:55:00 am
The AllMovie site has been replaced by AllRovi.



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

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.
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on March 16, 2011, 08:35:50 am
Quote
I wonder if it was possible script for AllMovie People Information.

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.

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).
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on March 16, 2011, 03:17:59 pm
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]
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 07, 2011, 05:20:48 pm
I have a question:

How this code

Code: [Select]
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;

and this code

Code: [Select]
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;

combine the information in the field pfBio (Biography).

Thanks for the help.
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 07, 2011, 06:55:06 pm
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]
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 13, 2011, 09:07:27 pm
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.


I worked a lot of tests but I could not find the right code, maybe someone might have some idea or solution for this,

Code: [Select]
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, 'Biography:' + #13 + TmpStr2);
 end;

and

Code: [Select]
procedure ParseFilmography(HTML : String);
var
 curPos, EndPos : Integer;
 TmpStr : String;
 Name, Role, URL, Year, Aka, Artist : String;
begin
 curPos := Pos('<div id="results-table">', HTML);
 if curPos < 1 then
  Exit;
  
 LogMessage('Pasrsing filmography...');
 
 TmpStr := '';

 EndPos := curPos;
 EndPos := PosFrom('width="35" align="center', HTML, curPos);
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 
 Year := Trim(Copy(HTML, curPos, EndPos - curPos));

 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;
  
  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 Year <> '' then
   TmpStr := TmpStr + '(' + Year + ')' + '  ';      
 
  EndPos := PosFrom('width="35" align="center">', HTML, curPos);
  curPos := curPos + Length('<tr><small>');
  EndPos := PosFrom('</td>', HTML, curPos);
  
  Aka := Copy(HTML, curPos + 5, EndPos - curPos - 16);

  EndPos := curPos;
  EndPos := PosFrom('width="130', HTML, curPos);
  curPos := PosFrom('">', HTML, EndPos) + 2;
  EndPos := PosFrom('</td>', HTML, curPos);

  Artist := Copy(HTML, curPos, EndPos - curPos);

  EndPos := curPos;
  EndPos := PosFrom('width="35" align="center', HTML, curPos);
  curPos := PosFrom('">', HTML, EndPos) + 2;
  EndPos := PosFrom('</td>', HTML, curPos);

  Year := Copy(HTML, curPos, EndPos - curPos);

  if Artist <> '' then
   TmpStr := TmpStr + '-  ' +  Artist;
  if Aka <> '' then
   TmpStr := TmpStr + #13 + 'Aka''s:  ' + Aka;
  
  if curPos > 0 then
   curPos := PosFrom('http://www.allmovie.com/work/', HTML, curPos)
  else
   Exit;  
 end;

 AddFieldValue(pfBio, 'Filmography:' + #13 + #13 + TmpStr);
end;

that would bring together the biography and filmography in field Biography.

Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 17, 2011, 12:38:02 pm
Quote
that would bring together the biography and filmography in field Biography.

or even both at once can copy together in one box.
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 17, 2011, 06:36:52 pm
Quote
that would bring together the biography and filmography in field Biography.

or even both at once can copy together in one box.

After many tests, I still have not found the right code, but still has only a data transfer for only Biography or for only a filmography.

Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on April 18, 2011, 04:14:26 pm
For perhaps any ideas or solutions from of previous post's here is E-mail for Guest:
Ivanrupnik@simobil.net - not work anymore

new E-mail
ivan.rupnik@amis.net

Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on May 03, 2011, 02:46:40 pm
Attention to important:

AllMovie script for People do not work anymore.
Title: Re: AllMovie script for People:Questions
Post by: Ivek23 on August 06, 2011, 01:32:08 pm
The AllMovie site has been replaced by AllRovi.