Links on Amazon Prime Video - IMDB, Rotten Tomatoes, Metacritic, YouTube Trailers

Adds links for searching titles from amazon.com/video

  1. // ==UserScript==
  2. // @name Links on Amazon Prime Video - IMDB, Rotten Tomatoes, Metacritic, YouTube Trailers
  3. // @description Adds links for searching titles from amazon.com/video
  4. // @version 0.2
  5. // @author mica
  6. // @namespace greasyfork.org/users/12559
  7. // @include https://www.amazon.com/gp/video/detail/*
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. $('head').append(`
  13. <style>
  14. #sbox {margin: 0 0 -15px -10px}
  15. #sbox a {margin: 0 8px}
  16. #sbox img {width: 24px; height: 24px;}
  17. </style>
  18. `);
  19. setTimeout(function() {
  20. var title = $('[data-automation-id|="title"]').text();
  21. if (title == '') {
  22. title = $('[data-testid|="title-art"]').find('img:first').attr('alt');
  23. }
  24. var mc = 'https://www.metacritic.com/search/all/' + encodeURIComponent(title.replace(/\*|\//g,' ')) + '/results';
  25. var imdb = 'https://www.imdb.com/find?s=tt&ref_=fn_tt&q=' + encodeURIComponent(title);
  26. var rt = 'https://www.rottentomatoes.com/search/?search=' + encodeURIComponent(title);
  27. var yt = 'https://www.youtube.com/results?search_query=' + encodeURIComponent(title) + ' trailer'
  28. $('.dv-node-dp-badges:eq(1)').append([
  29. $('<div>').attr('id', 'sbox').append([
  30. $('<a>').attr('href', mc).attr('target', '_blank').html('<img src="https://www.metacritic.com/favicon.ico">'),
  31. $('<a>').attr('href', imdb).attr('target', '_blank').html('<img src="https://www.imdb.com/favicon.ico">'),
  32. $('<a>').attr('href', rt).attr('target', '_blank').html('<img src="https://www.rottentomatoes.com/assets/pizza-pie/images/favicon.ico">'),
  33. $('<a>').attr('href', yt).attr('target', '_blank').html('<img src="https://www.youtube.com/s/desktop/f4861452/img/favicon_32x32.png">')
  34. ])
  35. ]);
  36. }, 2000);