twipai

Overwrite noisey users tweet with oppai in tweetdeck.

  1. // ==UserScript==
  2. // @name twipai
  3. // @namespace https://takachan-mirai.github.io
  4. // @description Overwrite noisey users tweet with oppai in tweetdeck.
  5. // @include /https?:\/\/tweetdeck\.twitter\.com.*/
  6. // @version 1.0.3
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (() => {
  11. let paiConfig = localStorage.getItem('twippai_config');
  12. let ids = paiConfig !== null && paiConfig !== undefined ? JSON.parse(paiConfig) : [];
  13.  
  14. let muting = (records) => {
  15. records.forEach((record) => {
  16. record.addedNodes.forEach((obj) => {
  17. if(obj.nodeType == Node.ELEMENT_NODE && obj.classList.contains('stream-item')) {
  18. const userName = obj.querySelector(".username");
  19. if(userName && ids.indexOf(userName.innerText) != '-1') {
  20. obj.querySelector(".tweet-text").innerHTML = 'おっぱい';
  21. }
  22. }
  23. });
  24. });
  25. };
  26.  
  27. let sw = true;
  28. while(sw) {
  29. if(document.querySelector('.application') != undefined) {
  30. let app = document.querySelector('.application');
  31. app.innerHTML += `
  32. <div id="paiconfig" style="position:fixed;bottom:10px;right:10px;background-color:#fff;padding:5px;z-index:10000;transition:1s;width:70px;height:20px;overflow:hidden;border-radius:10px;border:solid 1px #666;">
  33. <h2 style="text-align:center;padding-bottom:10px;color:#333;">ついっぱい</h2>
  34. <textarea id="paiId" style="width:100%;height:250px;"></textarea>
  35. </div>
  36. `;
  37. let paiconfig = document.getElementById('paiconfig');
  38. paiconfig.addEventListener('mouseenter', (e) => {
  39. e.target.style.height = '300px';
  40. e.target.style.width = '200px';
  41. });
  42. paiconfig.addEventListener('mouseleave', (e) => {
  43. e.target.style.height = '20px';
  44. e.target.style.width = '70px';
  45. });
  46.  
  47. //set mute
  48. let paiId = document.getElementById('paiId');
  49. paiId.value = ids.join('\n');
  50. paiId.addEventListener('keyup', (e) => {
  51. localStorage.setItem('twippai_config', JSON.stringify(e.target.value.split('\n')));
  52. });
  53.  
  54. let randCheck = document.body.querySelector('#rand');
  55.  
  56. //observe elements
  57. (new MutationObserver((info) => {
  58. muting(info);
  59. })).observe(document.body, {
  60. childList: true,
  61. attributes: false,
  62. characterData: false,
  63. subtree: true,
  64. attributeOldValue: false,
  65. characterDataOldValue: false
  66. });
  67. sw = false;
  68. }
  69. }
  70. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址