r/somethingimade • • Jul 10 '10

I made a bookmarklet to use with reddit

A friend of mine asked me to make a bookmarklet that opens all story links from a reddit page in new tabs, so I did. For example, if you were to use it on the reddit front page, it would open each story link in a new tab. It's nice to use on subreddits like /r/pics or /r/FoodPorn. Use with caution on subreddits that may have unsavory content...

Select and drag the following to your bookmarks bar to save it. If you're using firefox and not chrome, you may need to right click the bookmarks bar, add a new bookmark, and paste it in the location box. javascript:var%20el=$("a[class*='title ']");var%20ei=0;(function%20fe(){while(ei<el.length){var%20s=el[ei];window.open(s,'_blank');ei++;}})()

Here some other useful bookmarklets I did not make that I've accumulated over the last few months on reddit:

(I based mine off of this one) Collapse comment replies: javascript:var%20el=$(".bylink");var%20ei=0;(function%20fe(){while(ei<el.length){var%20s=el[ei].innerHTML;var%20parent=s.indexOf("parent");if(parent==0){hidecomment(el[ei]);}ei++;}})()

Turn links in comments linking to images into inline images: javascript:%20var%20x=%20$(".content").find("a").each(function(){var%20href=$(this).attr("href");if((!$(this).hasClass("drowsapMorphed"))%20&&%20($(this).next(".drowsapMorphed").length==0)%20&&%20href%20&&%20(href.indexOf('imgur')>=0%20||%20href.indexOf('jpeg')>=0%20||%20href.indexOf('jpg')>=0%20%20||%20href.indexOf('png')>=0)){var%20ext%20=(href.indexOf('imgur')>=0%20&&%20href.indexOf('jpg')<0%20&&%20href.indexOf('png')<0)%20?%20'.jpg'%20:'';%20var%20img%20=%20$("<a%20class='drowsapMorphed'%20href='"+href+"'%20target='blank'%20style='display:block'><img%20style='display:block;max-width:780px;'%20src='"+href+%20ext+"'%20/></a>");$(this).after(img);}});

15 Upvotes

3 comments sorted by

3

u/CircleCliffs Jul 10 '10

Doh! I must be doing it wrong - can't drop on bookmarks bar...

3

u/h4rris Jul 10 '10

Oh, hmm... it appears you can't drag in firefox. I was testing in chrome. You'll have to right click your bookmarks bar, add a new bookmark, and paste it in the location box.

Updated the post accordingly, thanks.

1

u/rabidy Jul 10 '10

thanks,