Last active
December 13, 2015 17:19
-
-
Save julien51/4946654 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var feeds = []; | |
var links = document.getElementsByTagName('link'); | |
for(var i = 0; i < links.length; i++) { | |
if(links[i].rel) { | |
if(links[i].rel.split(' ').indexOf('alternate') >= 0) { | |
if(links[i].href && links[i].href.length > 0) { | |
feeds.push(encodeURIComponent(links[i].href)); | |
} | |
} | |
} | |
} | |
var s = document.createElement('iframe'); | |
var url = window.location.toString(); | |
var resource = window.location.toString(); | |
s.setAttribute('style','position:fixed;top:0px; left:0px; width:100%; height:100%; border:0px; background: transparent; z-index: 2147483647'); | |
s.setAttribute('src', 'https://www.subtome.com/subscribe.html?resource=' + encodeURIComponent(resource) + '&feeds=' + feeds.join(',')); | |
var loaded = false; | |
s.onload = function() { | |
if(loaded) { | |
document.getElementsByTagName('body')[0].removeChild(s); | |
} | |
loaded = true; | |
} | |
document.getElementsByTagName('body')[0].appendChild(s); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment