English > Scripts and Templates

AllRovi movie script

<< < (7/26) > >>

Ivek23:

--- Quote ---As for DVD Releases, you're welcome to finish that or not. I've added the alternative option of adding a link (to the Releases page) to the standard Features field. As I recall discussing in the past, I believe this is better solution anyway. The list of links is not very informative, so an interested user is going to go to the website anyway.
--- End quote ---

Even just a link connection is fine so I
--- Quote ---procedure for Releases (DVD Releases) removed from the script
--- End quote ---
and such then I will add later gave in first post

rick.ca:

--- Quote ---and such then I will add later gave in first post
--- End quote ---

I will upload my version shortly. Please make your modifications to it—so I don't have to redo mine.

I was just thinking the script might be a tiny bit faster if it didn't have to download and parse Releases. Maybe the solution to whatever is going wrong with the poster routine is to put it into a separate procedure. It looks like the scripting engine was designed to be used that way—as suggested by the smPoster "script mode." If you can do that, and add a GET_POSTER option, the script would be faster for those of use who don't need posters.

Ivek23:
The problem is finding movies where there are at least two films with the same titles find a movie which was first written:
 What I think is so beautiful example Along Came a Spider .
Your movie with this title, Looking for which was built in 2001, However, it is found as the first from year 1970. If, however, such as manually added the correct URL is okay

Ivek23:

--- Quote from: Ivek23 on July 13, 2011, 05:34:47 am ---The problem is finding movies where there are at least two films with the same titles find a movie which was first written:
 What I think is so beautiful example Along Came a Spider .
Your movie with this title, Looking for which was built in 2001, However, it is found as the first from year 1970. If, however, such as manually added the correct URL is okay

--- End quote ---

Try this code ...


--- Code: ---procedure ParseSearchResults(HTML : String);
var
 curPos, EndPos : Integer;
 Title, Year, URL : String;
begin
 curPos := Pos('<div id="main" class="search-results movies">', HTML);
 if curPos < 1 then
  Exit;
 
 LogMessage('Parsing search results...'); 

  curPos := PosFrom('<a href="http://www.allrovi.com/movies/', HTML, curPos);
 while curPos > 0 do begin
  EndPos := PosFrom('" class="title">', HTML, curPos);
  URL := Copy(HTML, curPos + 31, EndPos - curPos - 31);
 
  URL := BASE_URL + URL;
  curPos := PosFrom('" class="title">', HTML, curPos);
  EndPos := PosFrom('</a>', HTML, curPos);
  Title := Copy(HTML, curPos+16, EndPos - curPos-16);
  EndPos := PosFrom('</dd>', HTML, curPos);
  Year:= ''
 
  AddSearchResult(Title, '', Year, URL, '');

  curPos := PosFrom('" href="/movies/', HTML, curPos);
 end;


 curPos := Pos('<div class="results">', HTML);
 if curPos < 1 then
  Exit;
 
curPos := PosFrom('<a href="http://www.allrovi.com/movies/', HTML, curPos);
 while curPos > 0 do begin
  EndPos := PosFrom('">', HTML, curPos);
  URL := Copy(HTML, curPos + 31, EndPos - curPos - 31);
 
   URL := BASE_URL + URL;

  curPos := PosFrom('">', HTML, curPos);
  EndPos := PosFrom('</a>', HTML, curPos);
  Title := Copy(HTML, curPos+2, EndPos - curPos-2);
  EndPos := PosFrom('</td>', HTML, curPos);
  Year:= ''
 
  AddSearchResult(Title, '', Year, URL, '');

   curPos := PosFrom('" href="/movies/', HTML, curPos);
 end;
end;

--- End code ---

rick.ca:

--- Quote ---Try this code ...
--- End quote ---

I just posted version 6, so I'll let you add this to version 7. If it improves the handling of ambiguous titles, that would be great. As I've been testing (generally updating movies already in my database), I've noticed it can make a bad selection from the search results. My old AllMovie+ script did that too, so I thought this might be something we have to live with. It would, of course, be much better if it asked if there were more than one movie in the search results.

Another thing I was wondering... For existing movies previously updated with Allmovies, would it be possible to get the saved Allmovie URL and convert it to a Rovi URL? If so, then a search and this sort of error could be avoided. 8)

There are a few things you should be aware of in version 6...


* I removed the DVD Releases code. It was a bit entangled with my addition of the link for the Features field.


* I changed some custom field names in an effort to standardize them. I think it will be easier on everyone if we all try to use the same names. There's probably some additional changes required. Generally, we should use exactly the same name as the source, unless that conflicts with an existing standard field. Yes, a custom field can have the same name, but it invites confusion. So, for example, use "Cast," not "Actors." ;)


* I've updated the attachment to the top post, but I'll attach it here as well—in case it's ever needed for historical reference.
I'm going to be busy with other things for the rest of the week, but I'll look forward to your updates.

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version