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

Gallery Script

Name: Anonymous 2009-05-10 6:24

Why doesn't my script work?


// @description      Creates a large Thumbnail collection from a given Google Image Search
// @include       http://images.google.*/*;
// ==/UserScript==


//var Knoten = window.document.images[0];
//window.document.images[0].parentNode.removeChild(Knoten);

function CreateImageObject(ThumbUrl, ImageUrl){
                nimghnd = document.createElement('img');
                nimghnd.width=96;
                nimghnd.height=96;
                nimghnd.border=0;
                nimghnd.src=ThumbUrl;
               

                nlnkhnd=document.createElement('a');
                nlnkhnd.href= ImageUrl.match( /\/imgres\?imgurl\=(.*?)\&imgrefurl\=/ )[1];
                nlnkhnd.appendChild(nimghnd);


                ntblhnd=document.createElement('table');
               
                ntblhnd.setAttribute('style', 'display:inline;');
                ntblhnd.width=140;
                ntblhnd.height=140;
                ntblhnd.border=0;
                ntblhnd.cellPadding=0;
                ntblhnd.cellSpacing=0;
               

                ntr1hnd=document.createElement('tr');ntr1hnd.height=22;ntr1hnd.width=140;
                ntr2hnd=document.createElement('tr');ntr2hnd.height=96;ntr2hnd.width=140;
                ntr3hnd=document.createElement('tr');ntr3hnd.height=22;ntr3hnd.width=140;

                ntd11hnd=document.createElement('td');ntd11hnd.width=22;ntd11hnd.height=22;
                ntd12hnd=document.createElement('td');ntd12hnd.width=96;ntd12hnd.height=22;
                ntd13hnd=document.createElement('td');ntd13hnd.width=22;ntd13hnd.height=22;

                ntd21hnd=document.createElement('td');ntd21hnd.width=22;ntd21hnd.height=96;
                ntd22hnd=document.createElement('td');ntd22hnd.width=96;ntd22hnd.height=96;
                ntd23hnd=document.createElement('td');ntd23hnd.width=22;ntd23hnd.height=96;

                ntd31hnd=document.createElement('td');ntd31hnd.width=22;ntd31hnd.height=22;
                ntd32hnd=document.createElement('td');ntd32hnd.width=96;ntd32hnd.height=22;
                ntd33hnd=document.createElement('td');ntd33hnd.width=22;ntd33hnd.height=22;

                ntd11hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/01.png');
                ntd12hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/02.png');
                ntd13hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/03.png');
                ntd21hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/04.png');
                ntd23hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/06.png');
                ntd31hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/07.png');
                ntd32hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/08.png');
                ntd33hnd.setAttribute('background', 'http://hansschmucker.free.fr/frame/09.png');

                ntr1hnd.appendChild(ntd11hnd);
                ntr1hnd.appendChild(ntd12hnd);
                ntr1hnd.appendChild(ntd13hnd);

                ntr2hnd.appendChild(ntd21hnd);
                ntr2hnd.appendChild(ntd22hnd);
                ntr2hnd.appendChild(ntd23hnd);

                ntr3hnd.appendChild(ntd31hnd);
                ntr3hnd.appendChild(ntd32hnd);
                ntr3hnd.appendChild(ntd33hnd);

                ntblhnd.appendChild(ntr1hnd);
                ntblhnd.appendChild(ntr2hnd);
                ntblhnd.appendChild(ntr3hnd);

                ntd22hnd.appendChild(nlnkhnd);
               
                return ntblhnd;
               
}


function Simplify(Source,Target){
    var tblnum=8;
    var tblhnd=Source.getElementsByTagName("table")[tblnum];

    var imgnum=1;

    for (var n = 0; n < 5; n++){
        var tblhnd=Source.getElementsByTagName("table")[tblnum];
        var lnkhnd=Source.getElementsByTagName("a")[tblnum];
        for (var i = 0; i < 4; i++){
            var imghnd=         tblhnd.getElementsByTagName(  "img")[     i];
            var lnkhnd=         tblhnd.getElementsByTagName(    "a")[     i];

            if (imghnd) {

                ntblhnd=CreateImageObject(imghnd.src,lnkhnd.href);
                Target.appendChild(ntblhnd);
           
            }
        }

        if(tblhnd){
            Source.getElementsByTagName("table")[tblnum].parentNode.removeChild(tblhnd);
        }
   
    }
}



prev=top.document.getElementsByTagName("body")[0];



if(top.location.href==self.location.href){
    var lnbrk=document.createElement('p');
    prev.appendChild(lnbrk);

    var page1=document.createElement('iframe');
    page1.src=self.location.href+"&theresadifference=intheurl";
    page1.width=1;
    page1.height=1;
    page1.border=0;
    page1.id="page1";
    lnbrk.appendChild(page1);
    for(i=1;i<12;i++){
        srchref= top.document.getElementsByTagName("div")[0].getElementsByTagName("a")[i].href;
        if((!srchref.match( /.*prev.*/ )) && (!srchref.match( /.*next.*/ )) && srchref.match( /.*images\.google.*/ )){
            var page1=document.createElement('iframe');
            page1.src=srchref;
            page1.width=1;
            page1.height=1;
            page1.border=0;
            page1.id="page1";
            lnbrk.appendChild(page1);
        }
    }

}else{
    prev=top.document.getElementsByTagName("body")[0];
    Simplify(document,prev);
    self.close;
}

Name: Anonymous 2009-06-14 11:06

>>40
Thanks man. I installed it but don't see any extra functionality to create a gallery. Maybe I'm missing something. Plus change namespace to


http://images.google.*;


So it works internationally.

Name: FrozenVoid 2009-06-14 13:27

>>41 what do you mean by gallery? Are you loading full images or not?
My script just makes it that if you click on images you directly open the full image,instead of loading the webpage with google frame on top.

____________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est

Name: Anonymous 2009-06-14 14:22

>>42
I meant can you debug the script in OPs post. It's supposed to allow you to create a massive gallery out of the results.

Google's image search results are much like the rest of the site, sparsely populated and easily rendered on virtually any computer. This script returns a compact selection of 200 images on a single page.1

_________________________________________________
[1] http://worshiptheglitch.com/2005/10/tweaking-firefox-and-opera-scripts-for.html

Name: Anonymous 2009-06-14 15:48

Name: FrozenVoid 2009-06-14 16:07

>>43
I don't understand what his script adds to the page. Its some useless 'eyecady'?
1.OP script works on single page. It doesn't load 200 images from google(ajax req.).
2.OP script build a stupid table when google already has the result page formatted as a table.
3.OP script needs frames for some reason.
If using more than one window is too hard for you, just use change index image:
onclick=document.getElementById('indimg').src=this.href;return false;

________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est

Name: Anonymous 2009-06-14 18:14

>>45
I don't see how any of those are good, let alone reasons to dislike REAL JavaScript code, man.

Name: Anonymous 2009-06-14 18:26

>>46
I don't see how, in this day and age, people can still see FrozenVoid's posts.

Name: Anonymous 2009-06-14 21:57

>>47
I didn't even realize that FrozenVoid was back. ...I'm upset now.

Name: Anonymous 2009-06-15 2:41

>>48
At least he isn't trolling or crashing servers.

Name: Anonymous 2009-06-15 16:36

>>45
Where do I put that code in OPs script?

Name: Anonymous 2009-06-16 5:32

bumped

Name: Anonymous 2009-07-30 4:41

>>49
Shut up sean.

Name: Anonymous 2010-12-09 8:16

Name: Anonymous 2011-01-31 20:01

<-- check em dubz

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