Check for robots

Easy script to check robots.txt content

  1. // ==UserScript==
  2. // @name Check for robots
  3. // @version 0.1
  4. // @description Easy script to check robots.txt content
  5. // @author Alfonso Gomez
  6. // @match http://*/*
  7. // @match https://*/*
  8. // @grant GM_xmlhttpRequest
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
  10. // @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
  11. // @grant GM_addStyle
  12. // @namespace https://greasyfork.org/users/145984
  13. // ==/UserScript==
  14.  
  15. GM_addStyle ( " \
  16. #dialogId { \
  17. z-index: 99999;background-color: #fff;padding: 2%;\
  18. } \
  19. .ui-dialog-titlebar{\
  20. width: 100%;\
  21. display: inline-table;\
  22. margin-bottom: 10%;\
  23. }\ \
  24. .ui-button{\
  25. float: right;\
  26. }\
  27. " );
  28.  
  29. (function() {
  30. $(document).on('click','#trigger', function(){
  31. var url = window.location;
  32. GM_xmlhttpRequest ( {
  33. method: 'GET',
  34. url: url + '/robots.txt',
  35. onload: function (responseDetails) {
  36. $("#dialog").html(responseDetails.response);
  37. $( "#dialog" ).dialog().parent().attr('id', 'dialogId');
  38. }
  39. } );
  40. });
  41. $('body').append('\
  42. <div id="dialog" title="Robots Result" style="display:none;white-space: pre-line"></div>\
  43. <a id="trigger" style="background-color: #f44336;border: none;color: white;padding: 15px 32px;text-align: center;text-decoration: none;display: inline-block;font-size: 16px;margin: 4px 2px;cursor: pointer;cursor:pointer;position: fixed;top: 0;right: 0;z-index: 999999;">Check for Robots TXT</a>\
  44. ');
  45. })();