Bitcoin Forum
August 15, 2018, 09:55:19 AM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Bookmarklet] Open all "new" links (watchlist, unread, new replies, etc)  (Read 969 times)
nimda
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


0xFB0D8D1534241423


View Profile
January 24, 2013, 01:03:32 AM
 #1

Meta seemed an appropriate place, as this is "discussion about the Bitcoin Forum," but I'm half-expecting this topic to be moved.

A bookmarklet is a small piece of javascript inside a bookmark. All modern browsers can use them.
I made one to open all "new" links on the watchlist page. Coupled with the right browser settings to make pop-ups appear in tabs, (or for Chrome, the One Window extension) it makes reading much easier.
Code:
var ls = new Array();
var ln = document.links.length;
var h; var n;
for(i=0;i<ln;i++){
h = document.links[i].href;
if(h.indexOf('new')>0){
ls.push(h);
}
}
if (ls.length > 6){
n = prompt("How many links?", 6);
}else{
n = ls.length;
}
for(i=0;i<n;i++){
window.open(ls[i]);
}
void(0);
Condensed:
Code:
javascript:(function(){var%20ls=new%20Array();var%20ln=document.links.length;var%20h;var%20n;for(i=0;i%3Cln;i++){h=document.links[i].href;if(h.indexOf('new')%3E0){ls.push(h);}}if(ls.length%20%3E%2010){n=prompt(%22How%20many%20links%3F%22,10);}else{n=ls.length;}for(i=0;i%3Cn;i++){window.open(ls[i]);}void(0);})();
Obviously I didn't spend any time optimizing, prettifying, or anything of that sort. It works.

I recommend asking me for a signature from my GPG key before doing a trade. I will NEVER deny such a request.
BOUNTY PORTALS
BLOG
WHERE BOUNTY MANAGEMENT
MEETS AUTOMATION
SIGNATURE CAMPAIGNS
TWITTER
FACEBOOK
MEDIA CAMPAIGNS
AND MORE!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1534326919
Hero Member
*
Offline Offline

Posts: 1534326919

View Profile Personal Message (Offline)

Ignore
1534326919
Reply with quote  #2

1534326919
Report to moderator
World
Hero Member
*****
Offline Offline

Activity: 743
Merit: 500



View Profile
January 24, 2013, 02:04:18 AM
 #2

useful thank you

Supporting people with beautiful creative ideas. Bitcoin is because of the developers,exchanges,merchants,miners,investors,users,machines and blockchain technologies work together.
nimda
Hero Member
*****
Offline Offline

Activity: 784
Merit: 1000


0xFB0D8D1534241423


View Profile
February 25, 2013, 11:05:39 PM
 #3

Probably should reload the watchlist afterward.
Code:
javascript:(function(){var ls=new Array();var ln=document.links.length;var h;var n;for(i=0;i<ln;i++){h=document.links[i].href;if(h.indexOf('new')>0){ls.push(h);}}if(ls.length > 8){n=prompt("How many links%3F",8);}else{n=ls.length;}for(i=0;i<n;i++){window.open(ls[i]);}location.reload();void(0);})();

I recommend asking me for a signature from my GPG key before doing a trade. I will NEVER deny such a request.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!