Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

4chan help program

Name: Anonymous 2009-01-03 13:37

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.)

Name: Anonymous 2009-01-09 23:08

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.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List