Moby Credits Textifier 2024

extract credits from mobygames - I'm using a temporary email for this greasyfork so don't expect updates <3

目前为 2024-03-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Moby Credits Textifier 2024
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @copyright https://en.wikipedia.org/wiki/WTFPL
  6. // @license WTFPL
  7. // @description extract credits from mobygames - I'm using a temporary email for this greasyfork so don't expect updates <3
  8. // @author Curious, aren't we?
  9. // @match https://www.mobygames.com/game/*/*/credits/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=mobygames.com
  11. // @require https://update.greasyfork.org/scripts/383527/701631/Wait_for_key_elements.js
  12. // @require https://code.jquery.com/jquery-3.7.1.min.js
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. // Your code here...
  20. waitForKeyElements("body", function() {
  21. var $ = window.jQuery;
  22. $('h1').after('<textarea style="background-color: LemonChiffon;" id="mobyex-txt"></textarea><button id="mobyex-btn">allText</button>');
  23. $('#mobyex-btn').click(function(){
  24. var txtCredits = '';
  25. $('table.table-credits > tbody > tr').each(function(){
  26. $(this).find('th h4').each(function(){
  27. txtCredits += '\n\n' + $(this).text();
  28. });
  29. $(this).find('td:nth-child(1)').each(function(){
  30. txtCredits += '\n\n' + $(this).text();
  31. });
  32. $(this).find('td:nth-child(2) ul li').each(function(){
  33. txtCredits += '\n' + $(this).text();
  34. });
  35. });
  36. $('#mobyex-txt').text(txtCredits.trim());
  37. });
  38. });
  39.  
  40. })();