A program to open every link of a specific board would be very helpful. I am by no means competent enough to do this but I hope somebody here can make this happen :-) (Please, don't flame.)
Excellent, thanks, but it opens every board instead of a single board's page. I'm trying to make it open every page (bonus points: every thread) of a board but it looks like I can't do it. Help, please!
:-)
Name:
Anonymous2009-01-03 15:51
It opens every link on the page that is currently open.
Name:
Anonymous2009-01-03 15:54
Hmm, it works on Firefox (I was using Chrome). Is there a way to filter out duplicate links and mailto:s?
Thanks!
Name:
Anonymous2009-01-03 16:00
Grr, I spoke too soon again. I should have known better :P
I thought it opened every topic (I'm dumb) but it opened a bunch of replies. (I was wondering how it opened every topic with that code)
I think I can get it to open only the pages of a board, but is it possible to open every topic?
Name:
Anonymous2009-01-03 16:06
javascript:var uniq=Object;for(var p=document.getElementsByTagName('a'),i=0;i<p.length;i++) {var h = p[i].href; if (h && !h.match(/^mailto:/) && uniq[h] == undefined){uniq[h]=1;window.open(h);}};void(0)
javascript:for(i=1;i<11;i++){h = i + ".html";window.open(h);}void(0)
This is the simple approach. Bookmark it and it will open in new tabs. (In good browsers)
I'm not sure how to open every thread, though.
Please help, I'd like to do this also.
This opens every thread on the topic page you are on.
When bookmarked, you can use it in combination with the script >>15 gave to get the effect >>1 wants. (Bookmark both javascripts, go to the first page of a board, click 15's script and for each page opened click my script.
I'm going to make this easy for everybody.
This is a great way to save a couple minutes of tedious clicking on 4chan.
To use this:
* Copy the code
* Create a new bookmark, paste the code in the location box, and give the bookmark a relevant title
(I placed my bookmarks on the bookmark toolbar for easy access)
Obviously, if you use all three codes you will need to make three separate bookmarks.
* Try it out:
Open your favorite image board and then "open" your bookmark.
It will run the code and open the links in new tabs.
Open every page on the board: (made to be run from the first page) javascript:(function(){var n=11;for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){var c=a[i];if(c.href.match("15.html")){var n=16;}}for(v=1;v<n;v++){var h=v+".html";window.open(h);}})()
Open every thread on the page: (can be run on any page) javascript:(function(){for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){var l=a[i];if(l.innerHTML.match("Reply")){window.open(l.href);}}})()
Open every image in the thread or page: (can be run in a thread or page) javascript:(function(){for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){var l=a[i];if(l.innerHTML.match("/thumb/")){window.open(l.href);}}})()
Because nobody reads every single board we won't even bother with that script.
Breakdown of scripts:
General knowledge: javascript:(function(){
*Creates an anonymous function. })()
*Ends creation of the function, and runs the function.
First script: Every page on board. var n=11;for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){
*Sets the initial value for n.
*Creates a loop that scans every link in the document. var c=a[i];if(c.href.match("15.html")){var n=16;}}
*Sets c to be an object containing the properties of the link currently being scanned.
*If there are 15 pages in the thread, set n to 16 (currently only /r/ has 15 pages) for(v=1;v<n;v++){var h=v+".html";window.open(h);}
*Creates a loop that counts from 1 to 11, or 1 to 16, depending on how many pages were detected earlier.
*Generates links to each page, and opens each link one at a time.
Second script: Every thread on page: for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){
*Scans every link in the document in a loop. var l=a[i];if(l.innerHTML.match("Reply")){window.open(l.href);
*Sets l to be an object containing the properties of the link being scanned.
*If the link's text says "Reply" (case-sensitive), open the link.
Third script: Every image in thread or page: for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){
*Scans every link in the document. var l=a[i];if(l.innerHTML.match("/thumb/")){window.open(l.href);
*Creates an object containing the properties of the link being scanned.
*If the link is a thumbnail, open the link.
This thread has reached a post by FrozenVoid. You cannot reply anymore.
Name:
Anonymous2009-01-10 3:32
>>30
Why would you need an anonymous function encapsulation when you can just write it inline? Isn't it superfluous to make your code executed by a function which can't be called externally?
Name:
Anonymous2010-08-22 13:36
Thanks for the script. I used it.
Here's a better version that works on any board. (opens every other page for the board you are viewing)