Bookmarklets


Note to self, edit the text highlighted in green.

Increment page [+]
javascript:(function(){ var e,s; IB=1; function isDigit(c) { return ("0" <= c && c <= "9") } L = location.href; LL = L.length; for (e=LL-1; e>=0; --e) if (isDigit(L.charAt(e))) { for(s=e-1; s>=0; --s) if (!isDigit(L.charAt(s))) break; break; } ++s; if (e<0) return; oldNum = L.substring(s,e+1); newNum = "" + (parseInt(oldNum,10) + IB); while (newNum.length < oldNum.length) newNum = "0" + newNum; location.href = L.substring(0,s) + newNum + L.slice(e+1); })();
Edit Page
javascript:document.body.contentEditable='true';document.designMode='on';
Blah selection in Blag
javascript: var w = window,
    g = w.getSelection,
    d = document.getSelection,
    t = ((g && g()) || (d && d()));
if (t = "") {
    t = prompt("Blah?")
};
if (t) {
    XXX
};
(minified)
javascript:var w=window,g=w.getSelection,d=document.getSelection,t=((g&&g())||(d&&d()));if(t=""){t=prompt("Blah?")};if(t){XXX};
Google translate to English
javascript:var w=window,g=w.getSelection,d=document.getSelection,t=((g&&g())||(d&&d()));if(t=""){t=prompt("Text?")};if(t){
w.open('http://translate.google.com/?hl=en&tl=en&sl=auto&text='+encodeURIComponent(t),'googletranslate');
};
else{window.open('http://translate.google.com/translate?hl=en&tl=en&u='+encodeURIComponent(location.href),'googletranslate');};
Speak selection (TTS)
javascript:var w=window,g=w.getSelection,d=document.getSelection,t=((g&&g())||(d&&d()));if(t=""){t=prompt("Text?")};if(t){
var s=w.speechSynthesis,m=new SpeechSynthesisUtterance(),f=function(){m.voice=s.getVoices().filter(function(voice){return /UK.*Fem/.test(voice.name)})[0];s.speak(m)}; m.rate=m.pitch=1;m.text=t;if(!s.getVoices().length){setTimeout(f,500)}
}else{f()};
Share to Pluspora
w.open('https://pluspora.com/bookmarklet?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href)+'&notes='+encodeURIComponent(t),'pluspora');
Quick search w/selection
typed file index
Random window key = new tab every time
javascript: var q = 'intitle:"index.of" (epub|pdf|txt) -(html htm php asp aspx)',
    s = 'https://www.google.com/search?hl=en&q=',
    h = (new Date % 9e6).toString(36),
    w = window,
    g = w.getSelection,
    d = document.getSelection,
    t = ((g && g()) || (d && d()));
if (t == "") {
    t = prompt("Search?")
};
if (t) {
    w.open(s + encodeURIComponent(t + ' ' + q), h);
};
(minified)
javascript:var q='intitle:"index.of" (epub|pdf|txt) -(html htm php asp aspx)',s='https://www.google.com/search?hl=en&q=',h=(new Date%9e6).toString(36),w=window,g=w.getSelection,d=document.getSelection,t=((g&&g())||(d&&d()));if(t==""){t=prompt("Search?")};if(t){w.open(s+encodeURIComponent(t+' '+q),h);};
DuckDuckGo
s='https://duckduckgo.com/?q='
The Movie Database
s='https://www.themoviedb.org/search?query='
magnet maker
var t='magnet:?xt=urn:btih:'+location.pathname.split('/')[1]+'&dn='+$('.downlinks > h2 > span').html();$('.trackers > dl > dt').each(function(){t=t+'&tr='+$(this).html().replace('/announce','')});console.log(t);$('h1 > a').attr('href',t);alert(t);

Instagram

Instagram -> Websta.me RSS

javascript:var a='www.instagram.com',b='websta.me/rss/n/';l=location.href;location.href=(l.includes(b)?l.replace(b,a):l.replace(a,b));

Reddit

Reddit sub/public multi (quick'n'dirty replace)
 <-> RedditP slideshow
javascript:var a='reddit',b=a+'p';l=location.href;location.href=(l.includes(b)?l.replace(b,a):l.replace(a,b));
<-> Imagoid gallery
b='imagoid';
<-> Removeddit
b='removeddit';
Reddit home/sub/multi (array of subs)
 -> Imagoid gallery
javascript: var r = [],
    p = location.pathname,
    n = (/\/m\//.test(p) ? (/\/me\//.test(p) ? 4 : 5) : (/\/r\//.test(p) ? 3 : 1)),
    l = p.split('/')[n],
    s = n > 3 ? 'ul.subreddits>li>a' : n > 1 ? 'h1.redditname>a' : 'div.drop-choices>a',
    m = n > 3 ? 2 : 4;
$(s).each(function() {
    r.push($(this).attr('href').split('/')[m])
});
window.open('http://www.imagoid.com/r/' + r.join('+') + (l ? '/' + l : l), 'imagoid' + r.length);
(minified)
javascript:var r=[],p=location.pathname,n=(/\/m\//.test(p)?(/\/me\//.test(p)?4:5):(/\/r\//.test(p)?3:1)),l=p.split('/')[n],s=n>3?'ul.subreddits>li>a':n>1?'h1.redditname>a':'div.drop-choices>a',m=n>3?2:4;$(s).each(function(){r.push($(this).attr('href').split('/')[m])});
window.open('http://www.imagoid.com/r/'+r.join('+')+(l?'/'+l:l),'imagoid'+r.length);
-> RedditP slideshow
window.open('https://redditp.com/r/'+r.join('+')+(l?'/'+l:l),'redditp'+r.length);
-> Scrolldit gallery/wall
window.open('http://www.scrolldit.com/?r=/r/'+r.join('%252B')+(l?'/'+l:l)+'&nsfw=1','scrolldit'+r.length);
Reddit video URL (on post or first expanded)
javascript:window.open(jQuery('div.reddit-video-player-root').attr('data-seek-preview-url'));
Shuffle saved
javascript:$.fn.randomize=function(a){(a?this.find(a):this).parent().each(function(){$(this).children(a).sort(function(){return Math.random()-0.5}).detach().appendTo(this)});return this};$('#siteTable').randomize('.thing');

Tumblr

Tumblr Gallery

javascript:window.open('http://stone.dialog.jp/tumblr/gallery.html?user='+location.hostname.split(".",1)[0]+'&small=250&large=400&start=0#');

Tumblr Thumbnails

javascript:window.open('http://tumb.la/'+location.hostname.split(".",1)[0]);

Tumblr Video frame

javascript:window.open=$("iframe[src*=video]")[0].src;

(from frame) Tumblr Video

javascript:window.location=$("video > source").src;

YouTube

YouTube full frame

javascript:var a='watch?v=',b='embed/';l=location.href;location.href=(l.includes(b)?l.replace(b,a):l.replace(a,b));

Comments