Greasy Fork is available in English.

mmmturkeybacon Numbered Google Results (with 10-per-page mod)

Numbers Google search results in the format M.N (page number, and result number 1-10 on that page). Google Instant should be disabled.

  1. // ==UserScript==
  2. // @name mmmturkeybacon Numbered Google Results (with 10-per-page mod)
  3. // @author mmmturkeybacon + clickhappier
  4. // @description Numbers Google search results in the format M.N (page number, and result number 1-10 on that page). Google Instant should be disabled.
  5. // @version 1.0.1.1c
  6. // @namespace http://userscripts.org/users/523367
  7. // @include https://www.google.*/search?*
  8. // @include https://www.google.*/?gws_rd=ssl*
  9. // @require http://code.jquery.com/jquery-latest.min.js
  10. // @grant GM_log
  11. // ==/UserScript==
  12.  
  13.  
  14. // v1, 2014-02-09 - mmmturkeybacon's original release on userscripts.org (imported to greasyfork on 2014-07-08)
  15. // v1c, 2014-07-02 - modified by clickhappier to add page numbering for 10-result pages
  16. // v1.0.1c, 2015-07-24 - Google's recent formatting changes broke it; rewrote it with jquery in the process of fixing it.
  17. // I saw after finishing that mmmturkeybacon rewrote his version in Mar-Apr 2015 too, and had added
  18. // 10-per-page support to it now as well as 'easy copy' and some other features, but I guess I'll keep
  19. // this around anyway for those who prefer this version.
  20.  
  21.  
  22. // If you have Google set to return 10 results per page (default), the first
  23. // page usually has 10 results, but sometimes it will have more or fewer.
  24. // If you change Results per page under Search Settings, Google will return
  25. // more results per page. The number of links on the page might not always be
  26. // the same as the number of results per page you chose. That's because Google
  27. // doesn't count every link it shows you as a result.
  28. // Ads and special results such as images aren't counted.
  29. // "More results from ..." are grouped with the link they are under, as one result.
  30.  
  31. // Google Instant should be disabled on each Google country domain you use
  32. // (Gear menu -> 'Search Settings' -> 'Never show Instant results.').
  33.  
  34.  
  35. function numberIt(jNode)
  36. {
  37.  
  38. var i;
  39. var result_num = 0;
  40. var page_num = 1;
  41. var page_str = '';
  42.  
  43. // add 10-per-page #s
  44. if ( $('table#nav tbody tr td.cur').text().trim().length )
  45. {
  46. page_num = $('table#nav tbody tr td.cur').text().trim();
  47. }
  48. page_str = page_num + '.';
  49. // end 10-per-page #s
  50.  
  51. $('.g div.rc h3.r').each(function(index)
  52. {
  53. if ( $(this).find('span.num').length )
  54. {
  55. console.log("numbered");
  56. return;
  57. }
  58. else
  59. {
  60. result_num++;
  61. if (result_num > 10)
  62. {
  63. page_num++;
  64. page_str = page_num + '.';
  65. result_num = result_num - 10;
  66. }
  67. $(this).html( '<span class="num">' + page_str + result_num + '</span>' + '&nbsp;-&nbsp;' + $(this).html() );
  68. }
  69. });
  70.  
  71. }
  72.  
  73. $(document).ready(numberIt);