Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save netravnen/3e58c0e83bae2b499152925eeda86954 to your computer and use it in GitHub Desktop.
Save netravnen/3e58c0e83bae2b499152925eeda86954 to your computer and use it in GitHub Desktop.
linuxComRedirect
// ==UserScript==
// @name linux.com News "Read more at" Redirect
// @namespace http://tampermonkey.net/
// @version 1
// @description Automatic redirect for linux.com articles to full stories
// @author Jeni4 <[email protected]>
// @match http://www.linux.com/news/*
// @match https://www.linux.com/news/*
// @grant none
// @updateURL https://gist.github.com/Jeni4/3e58c0e83bae2b499152925eeda86954/raw/960f22e35c31aed6db15b2f487759dcbf7fdfbc2/linux.com%2520News%2520%2522Read%2520more%2520at%2522%2520Redirect.user.js
// @downloadURL https://gist.github.com/Jeni4/3e58c0e83bae2b499152925eeda86954/raw/960f22e35c31aed6db15b2f487759dcbf7fdfbc2/linux.com%2520News%2520%2522Read%2520more%2520at%2522%2520Redirect.user.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var linuxLink = document.querySelector( 'div.field-item.even > p:last-child > a' );
try {
window.location.href=linuxLink.href;
}
catch (e) {
GM_log( 'linux.com News "Read more at" Redirect - script exception: ' + e );
alert ( 'linux.com News "Read more at" Redirect - script exception: ' + e );
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment