Guest User

k2nblog-ad-skipper.user

a guest
Mar 19th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        k2nblog ad skipper
  3. // @namespace   http://k2nblog.com/ad-skipper
  4. // @description Skip ads on sh.st, adf.ly, j.gs and q.gs
  5. // @include     http://sh.st/*
  6. // @include     http://adf.ly/*
  7. // @include     http://j.gs/*
  8. // @include     http://q.gs/*
  9. // @version     0.0.2
  10. // @grant       none
  11. // ==/UserScript==
  12.  
  13. // Written by deobfuscating adf.ly code.
  14. function decodeLink(cipher) {
  15.   var C = "";
  16.   var Z = "";
  17.   var i, len = cipher.length;
  18.   for (i = 0; i < len; ++i) {
  19.     if (i & 1) {
  20.       Z = cipher[i] + Z;
  21.     } else {
  22.       C += cipher[i];
  23.     }
  24.   }
  25.   return atob(C + Z).slice(2);
  26. }
  27.  
  28. if (location.host === "sh.st") {
  29.   var m = location.pathname.match(/\/(https?:.+)/);
  30.   if (m) {
  31.     location.href = m[1];
  32.   }
  33. } else if (location.host === "adf.ly" || location.host === "j.gs" || location.host === "q.gs") {
  34.   var m = location.href.match(/\/ad\/locked.*\?url=(\w+)/);
  35.   if (m) {
  36.     // adf.ly doesn't reveal links too often.
  37.     setTimeout(function() {
  38.       location.href = "/" + m[1];
  39.     }, 2000);
  40.   } else if (window.ysmm) {
  41.     location.href = decodeLink(ysmm);
  42.   }
  43. }
Add Comment
Please, Sign In to add comment