Author Topic: AllMovie.com_new movie script  (Read 119638 times)

0 Members and 3 Guests are viewing this topic.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com_new movie script
« Reply #40 on: April 30, 2013, 07:00:48 am »
I haven't tested thoroughly, but for the one movie I tried...The old version only got the first paragraph of the review. Maybe is failed because there was a photo in the second paragraph. The new version got the whole review.

BTW, neither version found the movie until I added the URL manually.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #41 on: April 30, 2013, 02:23:00 pm »
BTW, neither version found the movie until I added the URL manually.

Yes, the movie in the search results may not have been on the first page on which the script returns results. The problem of finding results at AllMovie new web pages is that the movie you are looking for, shown only the first 10 results on the first search page. If the search results in more than 10 hits, it is here the second page or multiple pages with 10 hits. The remaining pages of the search hits are AllMovie script not found and is required to manually enter the URL to the script then finds. These errors, which rarely occurs (at least I think so) in the search results, I do not know how to resolve this problem. Maybe someone can help solve this problem?
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #42 on: April 30, 2013, 02:24:38 pm »
Ivek,

v0113 is better than v0112. It now deletes extra paragraph spaces added when importing to a "Review" field, where the photos were on the site review tab. Great work, thank you!

I have a very, very personal and selfish appeal to you. Is it reasonable for you to save All Movie synopsis to some other field by default ("Comments", for eample). Is it possible, in addition to offer custom field for synopsis. Thanks in advance.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #43 on: April 30, 2013, 03:42:56 pm »
Ivek,

v0113 is better than v0112. It now deletes extra paragraph spaces added when importing to a "Review" field, where the photos were on the site review tab. Great work, thank you!

Thank you.

I have a very, very personal and selfish appeal to you. Is it reasonable for you to save All Movie synopsis to some other field by default ("Comments", for eample). Is it possible, in addition to offer custom field for synopsis. Thanks in advance.

No problem, can be transferred to a custom field.

There are several possibilities:

Some of it is added to the script.

For example:
Quote
Code: [Select]
if (TmpStr4 = 'synopsis') AND (Pos('©', TmpStr2) = 0) then
AddFieldValue(mfDescription, TmpStr2 + #13 + '— ' + TmpStr3)
else
if (TmpStr4 <> 'synopsis') OR (Pos('©', TmpStr2) = 1) then
LogMessage(' Synopsis: Not available');

if (TmpStr4 = 'synopsis') AND (Pos('©', TmpStr2) = 0) then
AddCustomFieldValueByName('AllMovie Synopsis', TmpStr2 + #13 + '— ' + TmpStr3)
else
if (TmpStr4 <> 'synopsis') OR (Pos('©', TmpStr2) = 1) then
LogMessage(' Synopsis: Not available');

Code: [Select]
//if (TmpStr4 = 'synopsis') AND (Pos('©', TmpStr2) = 0) then
// AddFieldValue(mfDescription, TmpStr2 + #13 + '— ' + TmpStr3)
//else
// if (TmpStr4 <> 'synopsis') OR (Pos('©', TmpStr2) = 1) then
// LogMessage(' Synopsis: Not available');

if (TmpStr4 = 'synopsis') AND (Pos('©', TmpStr2) = 0) then
AddCustomFieldValueByName('AllMovie Synopsis', TmpStr2 + #13 + '— ' + TmpStr3)
else
if (TmpStr4 <> 'synopsis') OR (Pos('©', TmpStr2) = 1) then
LogMessage(' Synopsis: Not available');

Code: [Select]
if (TmpStr4 = 'synopsis') AND (Pos('©', TmpStr2) = 0) then
AddCustomFieldValueByName('AllMovie Synopsis', TmpStr2 + #13 + '— ' + TmpStr3)
else
if (TmpStr4 <> 'synopsis') OR (Pos('©', TmpStr2) = 1) then
LogMessage(' Synopsis: Not available');

Another simple solution is to add "AllMovie Synopsis" custom field and in the settings set the way you AllMovie synopsis transferred to this custom field (see example in the attached picture - sshot-0, sshot-1 and sshot-2).

[attachment deleted by admin]
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #44 on: April 30, 2013, 05:40:04 pm »
Thanks.

« Last Edit: April 30, 2013, 05:52:30 pm by afrocuban »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #45 on: April 30, 2013, 07:20:17 pm »
Thanks.

Thank you for all the feedback.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #46 on: May 01, 2013, 07:54:50 am »
BTW, neither version found the movie until I added the URL manually.

There are also variants of the script did not find the movie:
  • It is possible that the film you are looking to contain inappropriate content (adult movies) and filter for the children of this film does not show in the list of search results (filter is already in primary settings). As far as I know, AllRovi websites use this filter and AllMovie new website also use this filter.
  • It is possible that the movie you are looking for is not listed in the AllMovie database. When I some time ago update my movie database with AllMovie_new script, I had a few examples of movies when AllMovie_new script did not find the movie, but with AllRovi script was found.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #47 on: May 01, 2013, 07:56:07 am »
AllMovie.com_new script
v 0.1.1.3.


I fixed all ParseReview:
piece of code

Code: [Select]
//~Review~

curPos := PosFrom('<span>', HTML, curPos);
endPos := PosFrom('</span>', HTML, curPos);
TmpStr5 := TextBetween(HTML, '<span>', '</span>', True, curPos);
curPos := PosFrom('<span>by', HTML, curPos);
endPos := PosFrom('</span>', HTML, curPos);

TmpStr3 := TextBetween(HTML, '<span>by ', '</span>', True, curPos)

curPos := PosFrom('<strong>', HTML, curPos);
endPos := PosFrom('</strong>', HTML, curPos);
TmpStr4 := TextBetween(HTML, '<strong>', '</strong>', True, curPos);

curPos := PosFrom('<p>', HTML, curPos);
endPos := PosFrom('</p>', 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);

AddCustomFieldValueByName('Review', TmpStr2 + #13 + '—' + TmpStr3);
changed in this part of the code
Code: [Select]
//~Review~

//curPos := PosFrom('<span>', HTML, curPos);
//endPos := PosFrom('</span>', HTML, curPos);
//TmpStr5 := TextBetween(HTML, '<span>', '</span>', True, curPos);
//curPos := PosFrom('<span>by', HTML, curPos);
//endPos := PosFrom('</span>', HTML, curPos);

//TmpStr3 := TextBetween(HTML, '<span>by ', '</span>', True, curPos)

//curPos := PosFrom('<strong>', HTML, curPos);
//endPos := PosFrom('</strong>', HTML, curPos);
//TmpStr4 := TextBetween(HTML, '<strong>', '</strong>', True, curPos);

//curPos := PosFrom('<p>', HTML, curPos);
//endPos := PosFrom('</div>', 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);

//AddCustomFieldValueByName('Review', TmpStr2 + #13 + '—' + TmpStr3);

curPos := PosFrom('<span itemprop="itemreviewed">', HTML, curPos);
endPos := PosFrom('</span>', HTML, curPos);
TmpStr5 := TextBetween(HTML, '<span itemprop="itemreviewed">', '</span>', True, curPos);
curPos := PosFrom('<span itemprop="rating">', HTML, curPos);
endPos := PosFrom('</span>', HTML, curPos);
TmpStr4 := TextBetween(HTML, '<span itemprop="rating">', '</span>', True, curPos);
curPos := PosFrom('<span itemprop="reviewer">', HTML, curPos);
endPos := PosFrom('</span>', HTML, curPos);

TmpStr3 := TextBetween(HTML, '<span itemprop="reviewer">', '</span>', True, curPos)

curPos := PosFrom('<span itemprop="description">', HTML, curPos)+ 29;
endPos := PosFrom('</span>', HTML, curPos);
TmpStr := Copy(HTML, curPos, endPos - curPos);

AddCustomFieldValueByName('Review', TmpStr + '—' + TmpStr3);

Prior to this change in the code, the transmission of info only to the first paragraph from the Review tab. After this change in the code, the transmission of info for all Review paragraphs from the Review tab (full review).

Notice:
The new version of the script is added to the Download page.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #48 on: May 01, 2013, 12:19:00 pm »
Thanks a lot Ivek. It works just as you described it.

Now, could you consider to create a "quick" allmovie script, just like you did for IMDb, for example? Just url, title and rating, let's say.

At least, I'd adapt one for my needs, if you'd describe me what "parts" of the code are obligatory for the script to work, beside url, title and rating sections. You can just publish script that works but imports nothing ("dummy" one, and I'd compare two scripts and set it for my needs. Don't laugh, I just don't know anything about programming, some basic, pascal and FORTRAN 25 years ago, and that's all, but helpful. ;D

This I need because I'm planning to import allmovie data for my all movies (~6000), and since it's impossible silent mode on to work with your script, I'd have to spend as less as possible time first to get urls for each single entry. In a second row, I'd turn the silent mode on, and let your full script to work the rest.

Thanks in advance.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com_new movie script
« Reply #49 on: May 01, 2013, 02:18:51 pm »
Quote
I'd have to spend as less as possible time first to get urls for each single entry.

You're not likely to save more time than what you're asking Ivek to spend. Run run the script overnight and see what you've got in the morning.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #50 on: May 01, 2013, 03:52:03 pm »
Now, could you consider to create a "quick" allmovie script, just like you did for IMDb, for example? Just url, title and rating, let's say.

You are really one big "Lucky" and you really are very lucky because I was able to fulfill your request.

AllMovie.com_simple script contains, in addition to your wishes, contains a year and a poster. Otherwise, it would also be possible to script would not work properly, if year and the poster would not be added there.

If there is anything superfluous to make this easy in the script block as shown in the attached code snippet below:
Code: [Select]
//AddCustomFieldValueByName('Updated', DateToStr(CurrentDateTime));
AllMovie.com_simple script is attached.

[attachment deleted by admin]
« Last Edit: May 01, 2013, 05:50:48 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #51 on: May 01, 2013, 09:04:50 pm »
Quote
You are really one big "Lucky" and you really are very lucky because I was able to fulfill your request.

Just let me know when you're in Belgrade. Beer's on me!  ;)
I don't understand the part about "Realeses/Features", but never mind. Thanks once again.

Quote
You're not likely to save more time than what you're asking Ivek to spend. Run run the script overnight and see what you've got in the morning.

Rick, can you clarify the scenario, please. I'm all ears (In case I wasn't the clear one, I don't have any allmovie record so far, so nothing will happen with silent mode on).

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com_new movie script
« Reply #52 on: May 01, 2013, 11:58:11 pm »
Quote
Rick, can you clarify the scenario, please. I'm all ears (In case I wasn't the clear one, I don't have any allmovie record so far, so nothing will happen with silent mode on).

Even if a script is getting just the URL, it's going to download at least the main page. To get all the information, it will have to download a few more pages (what you see as 'tabs' on the main page). But that will only add a few seconds for each movie.

It's been a long time for me, but I thought these scripts did a reasonable job of returning unique movies (based on a given [Title] and [Year]) when run in silent mode. To the extent that's not true and you're having to run the script manually (to choose the correct movie), why defer getting all the information when it only takes a few seconds more?

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #53 on: May 02, 2013, 12:52:13 am »
6000 movies times few seconds more...  :-\

I agree with you, it sounds logic to import data for the unique records found, though...

EDIT: I just managed to import a movie this way: My Wrongs 8245-8249 and 117. But it's too unique even for the uniques, it seems :o
« Last Edit: May 02, 2013, 01:14:25 am by afrocuban »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: AllMovie.com_new movie script
« Reply #54 on: May 02, 2013, 01:21:15 am »
Quote
I agree with you, it sounds logic to import data for the unique records found, though...


...it would be too easy? ???

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #55 on: May 02, 2013, 07:30:35 am »
Quote
You are really one big "Lucky" and you really are very lucky because I was able to fulfill your request.

Just let me know when you're in Belgrade. Beer's on me!  ;)

Thanks for the offer, but very difficult, I doubt that I will ever even come to Belgrade. The reason - it is just a little too far for me in recent times (I am partially disabled person due to amblyopia and already almost 10 years without a job).

BTW: Already we are in the month of love, May, therefore, a beautiful and warm greetings from Slovenia.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #56 on: May 02, 2013, 11:38:13 am »
Zelo mi je žal, da slišim slabe stvari o dobrih ljudi, kot ste vi.

My all the best, Ivek.

Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #57 on: May 02, 2013, 11:57:51 am »
Quote from: rick.ca
Run run the script overnight and see what you've got in the morning.

So, just to let you know, I did what you suggested to me, and this morning I found 1530 records with allmovie data, which is about 27% of all. Quite satisfied. Thank you for your time, too.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2713
    • View Profile
Re: AllMovie.com_new movie script
« Reply #58 on: May 02, 2013, 12:22:49 pm »
Zelo mi je žal, da slišim slabe stvari o dobrih ljudi, kot ste vi.

My all the best, Ivek.

Hvala.

Thanks.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 476
    • View Profile
Re: AllMovie.com_new movie script
« Reply #59 on: May 02, 2013, 08:24:12 pm »
Quote
The remaining pages of the search hits are AllMovie script not found and is required to manually enter the URL to the script then finds. These errors, which rarely occurs (at least I think so) in the search results, I do not know how to resolve this problem.

I tested the script in silent mode off and what I can say is that about some 10-15% of the movies aren't found in the first ten hits (on the firs page). What I noticed is, that if I used google to search allmovie.com for a specific title, I got 100% hits in first two results (the movie's always correct, but the first result might be /releases). Is it possible to use this information to improve the script?

Examples of the movies that aren't listed on the first ten search results at allmovie.com:

http://www.allmovie.com/movie/the-housemaid-v317173
http://www.allmovie.com/movie/el-camino-v434425
http://www.allmovie.com/movie/the-expendables-v474338
http://www.allmovie.com/movie/shanghai-v425881/
http://www.allmovie.com/movie/the-outlaw-v569124
http://www.allmovie.com/movie/loose-change-9-11-an-american-coup-v492684
http://www.allmovie.com/movie/the-life-and-death-of-a-porno-gang-v523933


 

anything