Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created May 23, 2013 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/5637534 to your computer and use it in GitHub Desktop.
Save barneycarroll/5637534 to your computer and use it in GitHub Desktop.
Read all of HackneyHipsterHate.tumblr.com inline (without having to click through for the posts). Probably works for other tumblrs too.
void function(){[].forEach.call(document.querySelectorAll('.read_more'),function(a){var x=new XMLHttpRequest();x.onload=function(){a.outerHTML=this.responseText.split('<!-- more -->')[1].split('<div class="footer')[0]};x.open('get',a.href,true);x.send()})}();
void function loadAllPosts(){
[].forEach.call(document.querySelectorAll('.read_more'), function ajaxThis(link){
var ajax = new XMLHttpRequest();
ajax.onload = function injectContent(){
link.outerHTML = this.responseText.split('<!-- more -->')[1].split('<div class="footer')[0];
};
ajax.open('get', link.href, true);
ajax.send();
});
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment