linuxtoday.com News "Complete Story" Redirect

Automatic redirect for linuxtoday.com articles to full stories

当前为 2021-08-03 提交的版本,查看 最新版本

  1. /******************************************************************************
  2.  
  3. * linuxtoday.com News "Complete Story" Redirect by Peter Butkovic (puk007 at gmail dot com)
  4. * Based on the Linux.org news "Read full article" redirect by Jaap Haitsma (jaap at haitsma dot org) see: http://userscripts.org/scripts/show/5350
  5. *
  6.  
  7. * version 0.2
  8.  
  9. * 2010-01-24
  10.  
  11. * Copyright (c) 2010, Peter Butkovic
  12.  
  13. * Released under the GPL license, version 4
  14.  
  15. * http://www.gnu.org/copyleft/gpl.html
  16.  
  17. ******************************************************************************
  18.  
  19. * On load of linuxtoday news story is done, there are links whose inner html is 'Complete Story' then:
  20.  
  21. * - redirect to reffered link in the actual window si done
  22.  
  23. *
  24.  
  25. * This script asumes linux today stories contains the text "Complete Story"
  26.  
  27. * in the link to the article.
  28. *
  29.  
  30. * It works (is tested) with:
  31.  
  32. * - Firefox 3.5.7 - Linux - Greasemonkey 0.8.20091209.04 http://greasemonkey.mozdev.org/
  33.  
  34. *
  35.  
  36. * To Install:
  37.  
  38. * - like any greasemonkey script: install greasemonkey, restart FF, open
  39.  
  40. * this script in a browser window, go to Tools/Install User Script
  41.  
  42. *
  43.  
  44. * To Uninstall:
  45.  
  46. * - like any greasemonkey script: Tools/Manage User Scripts, select
  47. * 'linuxtoday.com News "Complete Story" Redirect', click the Uninstall button
  48.  
  49. *
  50.  
  51. * Changelog:
  52. * ver 0.3
  53. * 2012-05-22
  54. * Derek Malone
  55. * - Updated the redirect links. (kept the old ones
  56. * just incase we needed to go back in time.)
  57. * BTW, awesome little script Mr. Butkovic!
  58. * ver 0.2
  59.  
  60. * 2010-01-24
  61.  
  62. * Peter Butkovic
  63.  
  64. * - process also links opened via rss
  65.  
  66. *
  67.  
  68. * ver 0.1
  69.  
  70. * 2010-01-24
  71.  
  72. * Peter Butkovic
  73.  
  74. * - 1.st ver
  75. */
  76.  
  77.  
  78.  
  79. // ==UserScript==
  80.  
  81. // @name linuxtoday.com News "Complete Story" Redirect
  82.  
  83. // @description Automatic redirect for linuxtoday.com articles to full stories
  84.  
  85. // @namespace http://userscript.org/
  86. // @include http*://www.linuxtoday.com/developer/*
  87. // @include http*://www.linuxtoday.com/developer/2*
  88. // @include http*://www.linuxtoday.com/high_performance/*
  89. // @include http*://www.linuxtoday.com/high_performance/2*
  90. // @include http*://www.linuxtoday.com/infrastructure/*
  91. // @include http*://www.linuxtoday.com/infrastructure/2*
  92. // @include http*://www.linuxtoday.com/it_management/*
  93. // @include http*://www.linuxtoday.com/it_management/2*
  94. // @include http*://www.linuxtoday.com/security/*
  95. // @include http*://www.linuxtoday.com/security/2*
  96. // @include http*://www.linuxtoday.com/storage/*
  97. // @include http*://www.linuxtoday.com/storage/2*
  98. // @include http*://www.linuxtoday.com/news_story.php3*
  99. // @include http*://www.linuxtoday.com/upload/*
  100. // @include https://www.linuxtoday.com/news/*
  101. // @include https://www.linuxtoday.com/blog/*
  102. // @grant none
  103. // @version 1.3
  104. // ==/UserScript==
  105.  
  106.  
  107.  
  108. (function() {
  109.  
  110. try {
  111.  
  112. textLink="Complete Story";
  113.  
  114. nPage=-1;
  115.  
  116. // opens 1.st such a link in tab
  117.  
  118. for( i=0; i < document.links.length; i++ )
  119.  
  120. if( document.links[ i ].innerHTML.match( textLink ))
  121.  
  122. window.location.href=document.links[i].href
  123. }
  124.  
  125. catch (e) {
  126.  
  127. GM_log( 'linuxtoday.com News "Complete Story" Redirect - script exception: ' + e );
  128.  
  129. alert ( 'linuxtoday.com News "Complete Story" Redirect - script exception: ' + e );
  130.  
  131. }
  132.  
  133. }
  134.  
  135. )();