add a search to instapaper and remove pagination

This is a bookmarklet to add a search to the unread folder of the free version of instapaper and to remove the pagination:

####
javascript:
var search = document.createElement(“div”);
search.innerHTML = “<input
onChange=\"var items = document.getElementsByClassName('tableViewCell'); for(var j= 0; j ‘”;
search.setAttribute(“Class”,”pagination”);
document.getElementById(“left_column”).insertBefore(search, document.getElementById(“bookmark_list”));

var end = false;
var pagenum = 2;
while(!end){
var request = new XMLHttpRequest(); request.open(“GET”, “http://www.instapaper.com/u/&#8221; + pagenum, false); request.onreadystatechange = function() { var done = 4, ok = 200; if (request.readyState == done && request.status == ok) { if (request.responseText) {
if(!request.responseText.contains(“No articles saved.”)){
insta = document.createElement(“div”);
insta.innerHTML = request.responseText;
var entries = insta.getElementsByClassName(“tableViewCell”);
for (var i = 0; i < entries.length; i++){document.getElementById("bookmark_list").appendChild(entries[i]);}
pagenum++;
}else{end=true;}
} } };
request.send(null);}
###

it was tested in firefox only

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: