Author Topic: AllMovie.com (movies)  (Read 51237 times)

0 Members and 2 Guests are viewing this topic.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
AllMovie.com (movies)
« on: June 24, 2008, 01:32:22 am »
Attached:
-Current version of the script [0.1.0.3]
-Downloads main information + Poster, Review, Product Credits, High Historical Importance, High Artistic Quality

The problems with search results will be fixed in the program itself a bit later.



The current version of this script is included with the program installation, but is available separately in this scripts archive (on the Download page).



[attachment deleted by admin]
« Last Edit: May 30, 2009, 04:15:29 am by rick.ca »
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #1 on: July 19, 2008, 07:48:47 pm »
I've noticed the rating returned by these scripts is often one less than it should be. It seems the problem is the rating is obtained from the "alternative name" of the star image, but (for reasons I can't fathom) this is incorrect. You could get the correct rating directly from the star image file name. That's st_rN.gif, where N = 1 to 9, representing 1 to 5 stars in 1/2 star increments. In other words, the rating = N + 1.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: AllMovie.com (movies)
« Reply #2 on: July 20, 2008, 11:31:52 am »
Are you sure that the rating in the image file is more precise (or correct) than the rating retrieved currently? It seemed vice versa to me...
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #3 on: July 20, 2008, 06:15:02 pm »
Here's a small sample:

American Beauty: 4.5 stars - <img src="/img/st_r8.gif" alt="4.5 Stars"> - correct
The Bank Job: 3.5 stars - <img src="/img/st_r6.gif" alt="3 Stars"> - incorrect
A Beautiful Mind: 4 stars - <img src="/img/st_r7.gif" alt="4 Stars"> - correct
Bend It Like Beckham: 3.5 stars - <img src="/img/st_r6.gif" alt="3 Stars"> - incorrect
Beyond Borders: 2 stars - <img src="/img/st_r3.gif" alt="1.5 Stars"> - incorrect
Big Fish: 3.5 stars - <img src="/img/st_r6.gif" alt="3 Stars"> - incorrect

In judging which is correct, I'm siding with the image because that is what is visible. Do you know what the "alt" version is used for? I can't be certain which is "more precise," although it was a sense some ratings in PVD were too low that attracted my attention.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: AllMovie.com (movies)
« Reply #4 on: March 11, 2009, 01:23:57 am »
The script is updated according to the new design of the site. There still some problems thou, but it should be ok until I find time to finish the script.
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #5 on: March 11, 2009, 07:24:58 am »
Thanks for the quick re-write. These may be the problems you know about, but I'll list here what I find anyway:

1. If there is no poster, the script throws up an error dialog with no error message in it. According to the movie I tested, they use the relative "<img src="/img/noimage200.png"..., rather than a complete url: Watchmen

[Edit:] Looking at this again, I wonder if 2, 3 and 4 are all the same issue—Genre and Director are not saved or saved in the wrong field if AKA data exists. If I turn AKA off in Overwrite fields, BTW, it still doesn't get Genre or Director if AKA exists. This seems consistent: Underground, Tin Drum

2. Sometimes Genre is saved in AKA: Body of Lies I don't see any difference in the source between those that work and those that don't.

3. AKA and Themes (Categories) are not saved.

4. Sometimes Director is saved, sometimes not: Body of Lies, Watchmen I don't see any difference in the source between those that work and those that don't.

5. Year, Actors, Country, Studio, MPAA, Tags, Description, Review and Duration seem to work correctly.

6. Got this error on Box office: Blade Runner

conversion error from string "27,580,111/ 1992 Rerelease: $3,740,330"
Overflow occurred during data type conversion.
Error Code: 14

« Last Edit: March 11, 2009, 10:24:14 pm by rick.ca »

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: AllMovie.com (movies)
« Reply #6 on: March 11, 2009, 08:54:41 pm »
Could you post titles of the movies that produce each type of error?
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #7 on: March 11, 2009, 10:32:13 pm »
Quote
Could you post titles of the movies that produce each type of error?

I've edited my original post.

Quote
There are still some problems when searching for movie titles with prefixes.

The search results I've seen are so consistently useless, it seems to go beyond prefixes. But allmovies searches (including those done directly on the website) have always been strange—so maybe this is one thing that hasn't changed.  ::)

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #8 on: March 12, 2009, 12:15:58 am »
I've noticed the rating returned by these scripts is often one less than it should be. It seems the problem is the rating is obtained from the "alternative name" of the star image, but (for reasons I can't fathom) this is incorrect. You could get the correct rating directly from the star image file name. That's st_rN.gif, where N = 1 to 9, representing 1 to 5 stars in 1/2 star increments. In other words, the rating = N + 1.

Just for the record, I see this has been fixed. I probably noticed before, but never got around to updating my existing ratings. It seems, too, allmovies has fixed the data that caused the problem in the first place.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: AllMovie.com (movies)
« Reply #9 on: March 12, 2009, 12:44:12 am »
OK, everything should be fixed now, except search results.
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #10 on: March 13, 2009, 03:12:03 am »
I'm modifying the script to handle additional data elements for custom fields. That's coming along quite nicely, but I need a little help. As a measure of my profound coding-lameness, I'm unable to introduce a simple variable to add two data elements together.

I would like to combine MPAA (e.g., "R") and MPAA Reasons (e.g., "language and sexual references") into the same way it's expressed on IMDb (e.g., "Rated R for language and sexual references.")

So MPAA is retrieved with...
Code: [Select]
//MPAA
 EndPos := PosFrom('style="width: 86px;', HTML, EndPos); //if no countries found set EndPos to the right position
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 AddFieldValue(mfMPAA, Copy(HTML, curPos, EndPos - curPos));

...and I'm adding MPAA reasons to a custom field with...
Code: [Select]
//MPAA Reasons
 AddCustomFieldValueByName('MPAA', HTMLValues(HTML,
              '<span>MPAA Reasons</span>', '</table>',
'<li>', '</li>',
', ', EndPos));

How can I modify this to combine the two and put the result into mfMPAA?

I realize this is a trivial thing—there are very few cases where the data won't already have come from IMDb—but I'll be able to use the same technique for other things.

Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: AllMovie.com (movies)
« Reply #11 on: March 13, 2009, 04:16:28 am »
There is already a variable for tremporary data declared: TmpStr
You need to do following:

Code: [Select]
//MPAA
EndPos := PosFrom('style="width: 86px;', HTML, EndPos); //if no countries found set EndPos to the right position
curPos := PosFrom('">', HTML, EndPos) + 2;
EndPos := PosFrom('</td>', HTML, curPos);
TmpStr := Copy(HTML, curPos, EndPos - curPos);

and then

Code: [Select]
//MPAA Reasons
 AddCustomFieldValueByName('MPAA', TmpStr + ' ' + HTMLValues(HTML,
              '<span>MPAA Reasons</span>', '</table>',
'<li>', '</li>',
', ', EndPos));

I have added a space like this ' ', so that it looks better.

P.S. I have not tested this code
Gentlemen, you can’t fight in here! This is the War Room!

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #12 on: March 13, 2009, 10:12:42 am »
Thanks! It turned out to be a little more complicated, but I figured it out...

I forgot to mention TmpStr is used between the two parts (in the Box Office section). Eventually, I figured out how to declare and use TmpStr2. Then, because I wanted it to be "Rated X for... .", it had to be conditional on a rating existing. So I'm using global variables and conditional statements—wow.  ::)

Is a date function available? I would like to be able to save the current date in a custom Date updated field.

Now that I'm running out of new things to add, I'm eyeing the Similar Works section (under Plot Synopsis). Is it possible to grab that list and add the movies to PVD's Connections (as a separate section, I suppose)—or is that beyond the scope of a script?

Quote
P.S. I have not tested this code

That's okay. You can test the script when it's finished. ;D
« Last Edit: March 13, 2009, 09:27:26 pm by rick.ca »

Offline Two Wire

  • User
  • ***
  • Posts: 32
    • View Profile
Re: AllMovie.com (movies)
« Reply #13 on: March 15, 2009, 05:31:35 pm »
Quote
Attached:
-Current version of the script [0.1.0.3]
Quote

Where is this attachment?  No can find. Help.
 Thanks

Offline tantrum829

  • Member
  • *
  • Posts: 10
    • View Profile
Re: AllMovie.com (movies)
« Reply #14 on: March 15, 2009, 05:42:08 pm »
Ok I am a little lost. I downloaded the new script but it wont replace the old one. I drag and drop it to the same place where the old one is and i assume it should
ask me if I want to overwrite the old file but it doesnt. The icon is different. It has a .txt icon instead of the .pvd

How do i change it.

Thanks

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #15 on: March 15, 2009, 05:55:09 pm »
The script is attached to the first message of this topic. It is named allmovie.psf. Copy it to your Scripts folder, overwriting the old one.

Offline tantrum829

  • Member
  • *
  • Posts: 10
    • View Profile
Re: AllMovie.com (movies)
« Reply #16 on: March 15, 2009, 06:04:18 pm »
That what I did but like I said it wont overwrite it it just copies it and sits next to the old script. The image the new script has a .txt icon

I have a screen capture but not sure how to attach to this post. i pressed the insert image icon but did not work.

Offline tantrum829

  • Member
  • *
  • Posts: 10
    • View Profile
Re: AllMovie.com (movies)
« Reply #17 on: March 15, 2009, 06:12:29 pm »
Okay. Here is a screen capture. Hope its readable.  http://img19.imageshack.us/img19/5209/screenshot003ajk.png

I got to go to work but I will be back on the forum later in case I dont reply back anytime soon.

Thanks.

Offline Two Wire

  • User
  • ***
  • Posts: 32
    • View Profile
Re: AllMovie.com (movies)
« Reply #18 on: March 15, 2009, 06:32:38 pm »
Thanks Rick. I spent 45 minutes looking for that updated script. I looked several times through the first post,. as well as reading and re-reading the other post. I did not see it even after you told me where to look. I was about to ask for specific directions when a speck on my screen csught attention. That got me close enough to a light blue hyperlink, and whala, there it was. I have poor vision, but I live and learn.

Thanks, it works great. no more error code.









Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com (movies)
« Reply #19 on: March 16, 2009, 12:40:12 am »
Quote
Here is a screen capture.

Uh-oh. I feel a Vista-tantrum coming.  :-X  It's no use...

What the heck is that?! Where are the file extensions? Surely you're not trusting icons to tell you the file type. Is there a file details mode that will actually reveal a little information about what you're looking at? What is the "Movies folder" (if that's what it is) and what are the files (if that's what they are) doing there? The normal installation directory for the program is C:\Program Files\Personal Video Database. Scripts must be in a subfolder of that directory named "Scripts." Is that what your screenshot is suppose to be of?

...tantrum <off>. Thank you for understanding. I can assure you that you can install PVD wherever you want, and, if a valid script with a PSF extension is placed in the \Scripts subfolder of that directory, it will be recognized by the program.

 

anything