Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. // ==UserScript==
  2. // @name GoogleFormFiller
  3. // @namespace Tikna
  4. // @description Random value completer
  5. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  6. // @include https://docs.google.com/forms/d/*
  7. // @version 1
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. this.$ = this.jQuery = jQuery.noConflict(true);
  12. $(document).ready(function()
  13. {
  14.  
  15. var myArray = ['21486','112313','223431321','9782348673','ram424','12077','234354','1212q23','Harshy','Mitega','mamla','Chalega', 'Arun', 'Kant' , 'Crazes', 'Surely','Hugerection','Chamunda','Imam', 'Bhatt', 'Rosesh', 'Sarabhai','Monisha', 'Ross','Monica','Chandler','Indu', 'Safe Heaven' ,'Inception', 'Dark Knigt','Mallu Antu','Harshyhsnd','fight club','Sweet November','Hasns','No Offensive Words Please','Thank you','Sorry','Who do you think you are','See you again','Castle of glass','November rain','guns n roses','YOu dont know you are beautiful','ring my bells','booty','Anaconda','TVF','The viral fever','What does the fox say','Long live Me','Viva la vida'];
  16. //alert("jQuery is loaded");
  17.  
  18. setTimeout(
  19. function()
  20. {
  21. $('input[type=checkbox]').each(function () {
  22. var ran = Math.floor(2 * Math.random() );
  23. ran = ran-1;
  24. if(ran)
  25. $(this).prop('checked',true);
  26. else
  27. $(this).prop('checked',false);
  28.  
  29. // var rand = myArray[Math.floor(Math.random() * myArray.length)];
  30. // alert($(this).val())
  31. // if($(this).val()== "palak" || $(this).val()=="kaddu" || $(this).val()=="Baingan Bharta" )
  32. // { $(this).prop('checked',true);}
  33. //
  34. });
  35. //do something special
  36. }, 100);
  37.  
  38.  
  39. setTimeout(function()
  40. {
  41. $('input[type=text]').each(function () {
  42. var rand = myArray[Math.floor(Math.random() * myArray.length)];
  43. $(this).val(rand);
  44. });
  45. //do something special
  46. }, 50);
  47.  
  48.  
  49. setTimeout(function()
  50. {
  51. $('textarea').each(function () {
  52. var rand = myArray[Math.floor(Math.random() * myArray.length)];
  53. $(this).val(rand);
  54. });
  55. //do something special
  56. }, 50);
  57.  
  58.  
  59. setTimeout(function()
  60. {
  61. var k = Math.floor(50 * Math.random() );
  62. var p = 1;
  63. var ch = 1;
  64. var radios = $('input[type=radio]')
  65. if (radios.length > 0) {
  66. var randomnumber = Math.floor(Math.random() * radios.length);
  67. radios[randomnumber].checked = true;
  68. }
  69. // $('input[type=radio]').each(function () {
  70. //var rand = myArray[Math.floor(Math.random() * myArray.length)];
  71. // if(p==1)
  72. // $(this).prop('checked',true);
  73. // if(k > 20*ch )
  74. // {$(this).prop('checked',true);
  75. // }
  76. // k = Math.floor(50 * Math.random() ) ;
  77. // p = p+1;
  78. // });
  79. //do something special
  80. }, 50);
  81.  
  82.  
  83.  
  84.  
  85. setTimeout(
  86. function()
  87. {
  88. $('input[type=submit]').each(function () {
  89. // alert("Submittting a button " + $(this).val());
  90. $(this).click();
  91. });
  92.  
  93. }, 2000);
  94.  
  95.  
  96.  
  97. // if(content.document.location = "https://docs.google.com/forms/d/1MeJLzUEOis3c68XUzxRlTO0zTJj6T1HXJNhHzrVqL_s/formResponse");
  98. // {
  99. // alert(current.document.location);
  100. // window.location.replace("https://docs.google.com/forms/d/1MeJLzUEOis3c68XUzxRlTO0zTJj6T1HXJNhHzrVqL_s/viewform");
  101.  
  102.  
  103. setTimeout(
  104. function()
  105. {
  106. // alert("submitting ");
  107. $('.ss-bottom-link')[0].click();
  108.  
  109. }, 500);
  110.  
  111.  
  112.  
  113. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement