SoHabr redirect

Redirects from unavailable posts to sohabr.net copies

  1. // ==UserScript==
  2. // @id habrahabr.ru-e7c04796-4bf7-4ec1-914c-c0f4d20e6b1e@scriptish
  3. // @name SoHabr redirect
  4. // @version 1.1
  5. // @namespace http://darkdaskin.tk/
  6. // @author Dark Daskin
  7. // @description Redirects from unavailable posts to sohabr.net copies
  8. // @include http://habrahabr.ru/post/*
  9. // @include http://geektimes.ru/post/*
  10. // @include http://megamozg.ru/post/*
  11. // @include https://habrahabr.ru/post/*
  12. // @include https://geektimes.ru/post/*
  13. // @include https://megamozg.ru/post/*
  14. // @run-at document-end
  15. // ==/UserScript==
  16.  
  17. var header = document.querySelector('#reg-wrapper h1');
  18. if (header && header.innerHTML === 'Доступ к публикации закрыт') {
  19. location.host = 'sohabr.net';
  20. }