linuxtoday.com News "Complete Story" Redirect

Automatic redirect for linuxtoday.com articles to full stories

  1. /******************************************************************************
  2. * linuxtoday.com News "Complete Story" Redirect by Peter Butkovic (puk007 at gmail dot com)
  3. * 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
  4. *
  5. * version 1.4
  6. * 2010-01-24
  7. * Copyright (c) 2010, Peter Butkovic
  8. * Released under the GPL license, version 4
  9. * http://www.gnu.org/copyleft/gpl.html
  10. ******************************************************************************
  11. * On load of linuxtoday news story is done, there are links whose inner html is 'Complete Story' then:
  12. * - redirect to reffered link in the actual window si done
  13. *
  14. * This script asumes linux today stories contains the text "Complete Story"
  15. * in the link to the article.
  16. *
  17. * It works (is tested) with:
  18. * - Firefox 3.5.7 - Linux - Greasemonkey 0.8.20091209.04 http://greasemonkey.mozdev.org/
  19. *
  20. * To Install:
  21. * - like any greasemonkey script: install greasemonkey, restart FF, open
  22. * this script in a browser window, go to Tools/Install User Script
  23. *
  24. * To Uninstall:
  25. * - like any greasemonkey script: Tools/Manage User Scripts, select
  26. * 'linuxtoday.com News "Complete Story" Redirect', click the Uninstall button
  27. */
  28.  
  29.  
  30. // ==UserScript==
  31.  
  32. // @name linuxtoday.com News "Complete Story" Redirect
  33. // @description Automatic redirect for linuxtoday.com articles to full stories
  34. // @namespace http://userscript.org/
  35. // @include http*://www.linuxtoday.com/developer/*
  36. // @include http*://www.linuxtoday.com/developer/2*
  37. // @include http*://www.linuxtoday.com/high_performance/*
  38. // @include http*://www.linuxtoday.com/high_performance/2*
  39. // @include http*://www.linuxtoday.com/infrastructure/*
  40. // @include http*://www.linuxtoday.com/infrastructure/2*
  41. // @include http*://www.linuxtoday.com/it_management/*
  42. // @include http*://www.linuxtoday.com/it_management/2*
  43. // @include http*://www.linuxtoday.com/security/*
  44. // @include http*://www.linuxtoday.com/security/2*
  45. // @include http*://www.linuxtoday.com/storage/*
  46. // @include http*://www.linuxtoday.com/storage/2*
  47. // @include http*://www.linuxtoday.com/news_story.php3*
  48. // @include http*://www.linuxtoday.com/upload/*
  49. // @include https://www.linuxtoday.com/news/*
  50. // @include https://www.linuxtoday.com/blog/*
  51. // @grant none
  52. // @version 1.4
  53. // ==/UserScript==
  54.  
  55. var i = 0;
  56. var textLink = '';
  57. var nPage = '';
  58.  
  59. (function () {
  60. try {
  61. textLink = "Complete Story";
  62.  
  63. nPage = -1;
  64.  
  65. // opens 1.st such a link in tab
  66. for (i = 0; i < document.links.length; i++) {
  67. if (document.links[i].innerHTML.match(textLink)) {
  68. window.location.href = document.links[i].href
  69. }
  70. }
  71. } catch (err) {
  72. GM_log('linuxtoday.com News "Complete Story" Redirect - script exception: ' + err);
  73. alert('linuxtoday.com News "Complete Story" Redirect - script exception: ' + err);
  74. }
  75. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址