Bakchodi

Replaces keywords appearing in the Indian liberal media with proper Indianized terms.

  1. // ==UserScript==
  2. // @name Bakchodi
  3. // @namespace Buffaloshark
  4. // @version 0.2
  5. // @description Replaces keywords appearing in the Indian liberal media with proper Indianized terms.
  6. // @author BuffaloShark
  7. // @include http://www.huffingtonpost.in/*
  8. // @include http://huffingtonpost.in/*
  9. // @include https://huffingtonpost.in/*
  10. // @include https://www.huffingtonpost.in/*
  11. // @include http://scroll.in/*
  12. // @include http://www.scroll.in/*
  13. // @include https://scroll.in/*
  14. // @include https://www.scroll.in/*
  15. // @include https://www.thequint.com/*
  16. // @include http://www.thequint.com/*
  17. // @include http://thequint.com/*
  18. // @include https://thequint.com/*
  19. // @include http://www.ndtv.com/*
  20. // @include https://www.ndtv.com/*
  21. // @license MIT License
  22. // @match http://*/*
  23. // @match https://*/*
  24. // ==/UserScript==
  25.  
  26. var elements = document.getElementsByTagName("*");
  27.  
  28. var dictionary = [
  29. [/ muslim/gi, " Dharmic "],
  30. [/ hindu/gi, " Katua "],
  31. [/ secular/gi, " Anti-hindu "],
  32. [/ secularism/gi, " Communalism "],
  33. [/ pakistan/gi, " Porkistan "],
  34. [/Modi/gi, " 56 Inch-ka-seena "],
  35. [/ india/gi, " Akhand-bharat"],
  36. [/ rss/gi, " AIMIM "],
  37. [/ rape /gi, " Love-jihad "],
  38. [/ raped /gi, " Islamized "],
  39. [/ israel /gi, " Our Greatest Ally "],
  40. [/ dalit/gi, " Toilet Cleaner "],
  41. [/ Tamil Nadu /gi, " Lungiland "],
  42. [/ Karnataka /gi, " Lungiland "],
  43. [/ Andhra Pradesh /gi, " Lungiland "],
  44. [/ Kerala /gi, " Commieland "],
  45. [/ kejriwal /gi, " Haraamkhor "]
  46.  
  47. ];
  48.  
  49. function wordReplace(text)
  50. {
  51. var replaced = text;
  52. for(dictI = 0; dictI < dictionary.length; dictI++)
  53. replaced = replaced.replace(dictionary[dictI][0], dictionary[dictI][1]);
  54.  
  55. return replaced;
  56. }
  57.  
  58. for(var i = 0; i < elements.length; i++)
  59. {
  60. var el = elements[i];
  61.  
  62. for(var j = 0; j < el.childNodes.length; j++)
  63. {
  64. var node = el.childNodes[j];
  65. if(node.nodeType === 3)
  66. {
  67. var text = node.nodeValue;
  68. var replaced = wordReplace(text);
  69.  
  70. if(replaced !== text)
  71. el.replaceChild(document.createTextNode(replaced), node);
  72. }
  73. }
  74. }