IMDB script suggestion: also get the amount of votes

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Dorohedoro
Posts: 42
Joined: 2016-12-13 00:45:45

IMDB script suggestion: also get the amount of votes

Post by Dorohedoro »

In my opinion it would be useful for us to also get the amount of votes:

Image

and the result in antp should be something like this:

Image

Thanks!!
Dorohedoro
Posts: 42
Joined: 2016-12-13 00:45:45

Re: IMDB script suggestion: also get the amount of votes

Post by Dorohedoro »

Ok guys with the help of the search function of the forum and chatgpt I was able to achieve a workaround, both the imdb script and the html template.

**For the imdb script you should replace this:

Code: Select all

Value := TextBetween(PageText, '<a href="ratings" class="tn15more">', '</a>');
      if Value <> '' then
        Value := 'User Rating: ' + GetField(fieldRating) + ' out of 10  (with ' + Value + ')';
      if (GetOption('UserRatings') = 1) and (Value <> '') and (CanSetField(fieldMediaType)) then
        SetField(fieldMediaType, Value);
      if (GetOption('UserRatings') = 2) and (Value <> '') then
        SetField(fieldComments, GetField(fieldComments) + #13#10 + #13#10 + Value);
    end;
with this:

Code: Select all

Value := TextBetween(PageText, 'total-votes">(', ')<');
    // Value := TextBetween(PageText, '<a href="ratings" class="tn15more">', '</a>');
      if Value <> '' then
        Value := Copy(GetField(fieldRating), Pos('(', GetField(fieldRating)) + 1, Pos(')', GetField(fieldRating)) - Pos('(', GetField(fieldRating)) - 1) + '' + Value;
      if (GetOption('UserRatings') = 1) and (Value <> '') and (CanSetField(fieldsubtitles)) then
        SetField(fieldsubtitles, Value);
      if (GetOption('UserRatings') = 2) and (Value <> '') then
        SetField(fieldComments, GetField(fieldComments) + #13#10 + #13#10 + Value);
    end;
**For your html template you should add the following code below the $$LABEL_RATING lines (it will replace the subtitles field with the amount of votes):

Code: Select all

<address>
  <strong>
	($$ITEM_SUBTITLES)</font></strong></address>
</div>
This is the final result, exaclty what I wanted:

Image

But my suggestion for this to be in the default script still stands. Thanks!
Post Reply