andreameier2 / movie-blog.org navigator

// ==UserScript==
// @name        movie-blog.org navigator
// @author      andreameier2
// @description Navigiere mit den Pfeiltasten.
// @include     http://*movie-blog.org/*
// @version     1
// @grant       none
// ==/UserScript==

// < 37
// > 39
// + 107
// - 109

// On ArrowkeyLeft or - loads the previous Page and the Arrowkey right and + loads the next Page on the site "Updates" (Our Girls).

// first
// previouspostslink
// current
// nextpostslink
// last
(function(){

    var s = window.location.search.substring(1).split('&');

    if(!s.length) return;

    var c = {};

    for(var i  = 0; i < s.length; i++)  {

        var parts = s[i].split('=');

        c[unescape(parts[0])] = unescape(parts[1]);

    }

    window.$_GET = function(name){return name ? c[name] : c;}

}())

if(document.getElementsByClassName('previouspostslink').item(0)){
	var previous = document.getElementsByClassName('previouspostslink').item(0).getAttribute('href');	
}
if(document.getElementsByClassName('nextpostslink').item(0)){
	var next = document.getElementsByClassName('nextpostslink').item(0).getAttribute('href');	
}

document.onkeydown = function(event) {
  if (event.keyCode == 39 || event.keyCode == 107) {
    //alert(next);
	if(next){ location.href=next; }
  }else if (event.keyCode == 37 || event.keyCode == 109) {
    //alert(prev);
	if(previous){ location.href=previous; }
  }
}