Advertisement
Guest User

Untitled

a guest
Jan 13th, 2013
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. /*
  2. Anti-pony script v0.3, (c) 2013 CrazyRussian
  3. Установить как UserJS скрипт для оперы.
  4. */
  5. var Users = new Array("Skaarj","FiEctro","Raid","XaeroX","ForestGirl","St.Snoop","PekpyT","shtopor7","A[KUSH]ER","FARSH","GetCracked","PoD-Stas","noSICK","Hedgehog","XAN","Nuclear");
  6.  
  7. function ZeroPaddedStr(str,zeroes)
  8. {
  9. ret = str;
  10. while(ret.length < zeroes)
  11. ret = "0" + ret;
  12.  
  13. return ret;
  14. }
  15.  
  16. function GetCatPicture()
  17. {
  18. var index = (Math.floor(1 + Math.random() * (2 - 1) + 0.5));
  19. switch(index)
  20. {
  21. case 3:
  22. return "http://dl.ziza.ru/other/022010/02/koshki/" + ZeroPaddedStr((Math.floor(1 + Math.random() * (98 - 1) + 0.5)).toString(),3) + ".jpg";
  23. case 2:
  24. return "http://art.mau.ru/foto_cats/cats/" + ZeroPaddedStr((Math.floor(1 + Math.random() * (12 - 1) + 0.5)).toString(),3) +".jpg"
  25.  
  26. }
  27. }
  28.  
  29. (function() {
  30. opera.addEventListener('BeforeEvent.DOMContentLoaded',
  31. function(ev)
  32. {
  33. clear_pics = false;
  34. title = new String(document.title);
  35. if (title.indexOf("My Little Pony: Friendship is Magic") != -1)
  36. {
  37. clear_pics = true;
  38. }
  39. for (var i = 0 ; i < document.images.length ; i++)
  40. {
  41. var title = new String(document.images[i].title);
  42. var path = new String(document.images[i].src);
  43.  
  44. if (path == "http://cs-mapping.com.ua/news/upload/4401e07df95c02f71b318db5e2945014.jpg")
  45. {
  46. document.images[i].src = GetCatPicture();
  47. document.images[i].width = "409";
  48. document.images[i].height = "245";
  49. continue;
  50. }
  51.  
  52. if (clear_pics && path.indexOf("cs-mapping.com.ua") == -1)
  53. {
  54. document.images[i].src = GetCatPicture();
  55. continue;
  56. }
  57.  
  58.  
  59. for(var j = 0 ; j < Users.length; j++)
  60. {
  61. if (title.indexOf(Users[j]) == -1) continue;
  62. if (path.indexOf("customavatars") == -1) continue;
  63. document.images[i].src = GetCatPicture();
  64. document.images[i].width = "180";
  65. document.images[i].height = "200";
  66. break;
  67. }
  68. }
  69. }
  70. , true);
  71. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement