A few little niggly bits I've noticed so far...
Thanks! My routine of downloading from two sources is concealing some bugs.
1. Box Office doesn't format correctly in the standard field. Works fine as a "short text" custom entry
Yes, I started with a custom field, but then decided I would prefer to use the standard. So I reverted to nostra's code. A simple dollar figure seems to work. But "$106,260,000/ Top grossing film of 1979" becomes "1,062,600,009" (!) Obviously the standard field is numeric. So I added the "+ 1" in the following:
//Box office
curPos := PosFrom('<span>Box office</span>', HTML, EndPos);
if curPos > 0 then begin
curPos := PosFrom('<li>', HTML, curPos) + 5;
EndPos := PosFrom('</li>', HTML, curPos);
TmpStr := Copy(HTML, curPos, EndPos - curPos);
curPos := Pos('/', TmpStr);
if curPos > 0 then
Delete(TmpStr, curPos, Length(TmpStr) - curPos + 1); <-----
curPos := Pos(':', TmpStr);
if curPos > 0 then
Delete(TmpStr, curPos, Length(TmpStr) - curPos + 1); <-----
AddFieldValueXML('money', TmpStr);
end;
I don't really understand the code (imagine a monkey banging on the keyboard
), so I'm not sure if that's an appropriate modification, although it seems to work for ones I can find. Allmovies doesn't seem to have much box office data—which is why I decided against an additional custom field.
2. Your MPAA + Reason formatting works okay, but if there is no reason listed, you get an output of "Rated M for ." etc
Yes, just being lazy here. I only use this a backup to IMDb, which normally have exactly the same data (that's where the "Rated X for ..." format comes from). I couldn't be bothered fixing it for the rare case where IMDb would not have the data, and allmovie would have the rating but not the reason. Still, just fixing it would be easier than making excuses...
//MPAA Reasons
TmpStr1 := HTMLValues(HTML, '<span>MPAA Reasons</span>', '</table>', '<li>', '</li>', ', ', EndPos);
if (TmpStr1 = '') AND (TmpStr2 <> '') then
AddFieldValue(mfMPAA, 'Rated ' + TmpStr2);
if (TmpStr1 <> '') AND (TmpStr2 <> '') then
AddFieldValue(mfMPAA, 'Rated ' + TmpStr2 + ' ' + TmpStr1 + '.');
...well, maybe not. I think that does it, but I'm not sure.
3. I added support for the "Region" field in AMG.
I think that the one that only occurred in 2% of my movies—so I deleted it. There are a number of such obscure items. The site design is very annoying. Tags like that are usually linked to a page with a definition of the term and/or a list of movies with the tag value, but there's no other way to access those pages. In other words, I have to know of a movie tagged with a region before I can find out anything about that tag. To enumerate a few examples...
854: From Play
855: From Poem By
856: From Poem
857: From Screenplay By
858: From Screenplay
860: From Story
861: Lampoons "Name" (?)
862: Location
862: Movie Budget
862: Recognizable Quote...
Sorry—thought I might find "Region" or something interesting if I kept going. I think they're on drugs, or just want to piss-off script writers.
If only we had the entire list of tags
and they appeared on the page in tag number order (they don't), that would be a more reliable way to reference these items, and perhaps aggregate some of them into something useful. For example, the "From" ones could be combined into one field populated with "From book ____", "From play ____", etc. )I combined Book and Story, but I couldn't find the rest.)
4. I seem to get a rating of 10 for every movie... must have a closer look.
Their rating tend to be generous, but that's not right. I don't know why this may cause you a problem, but note the script is using a custom field, rather than the usual (i.e., as in nostra's version)
Other rating field.
I'm not sure if it was you or Nostra who added the Reviews and Production Credits functionality, but that's awesome
That would be nostra. I'm hoping you'll study his technique and use it to grab the "Similar Works" entries from the Overview page and save them as
Connections. While it wouldn't be quite as useful, it would nevertheless be super-awesome! Besides, there's nothing left to grab, so this one's yours.