When debugging scripts, the Javascript console is your biggest ally.

In this case, after making the change suggested by you, I was getting this
error:

Error: pics is null
Source File:
file:///home/owner/.mozilla/firefox-3.5/pqajdhf4.Neobux%20Renting/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js
Line: 389

The line number is wrong, but it does point to the error that is stopping
the script from working.


I've not been on the site before but it appears that the site also changed
another part of the page. I changed line 30 of the script from this:

      var pics = a.responseText.match(/\/.+#pic/g), i = 0, base =
location.protocol + "//" + location.host;

to this:

      var pics = a.responseText.match(/\/.+#bp/g), i = 0, base =
location.protocol + "//" + location.host;


and I am now seeing a list of direct links to the images that are in all
other pages and zero errors in my error console (I also recommend that you
check out the console^2 addon).






2009/11/16 esquifit <[email protected]>

> Your script and mine are identical, but mine wokrs. I cannot figure
> out where the problem lies, sorry.
>
> On Mon, Nov 16, 2009 at 7:08 AM, jaeb0922 <[email protected]> wrote:
> > ok after this im saying screw this thing cause no scripts will work
> > and its just annoying at this point.
> >
> > here is the total script
> >
> > // ==UserScript==
> > // @name           imgsrc.ru => get all image links
> > // @namespace      #avg
> > // @include        http://*imgsrc.ru/*
> > // @version        0.3.5
> > // ==/UserScript==
> > GM_addStyle("body > a {clear:both;float:left;}");  // css hack to
> > display links on new lines
> > var addImg=function(text) {            // generic image adder handler
> >                link=document.createElement("a");
> >                link.innerHTML=/description.+, ([^"]+)/.exec(text)[1];
> >                link.href=/class=big src=(\S+)/.exec(text)[1];
> >                document.body.appendChild(link);
> >    },
> >    requestPic=function(img){   // set-up single image handler
> >    GM_xmlhttpRequest({method: 'GET',url: img,onload:function(a)
> > {addImg(a.responseText)}})
> >    };
> >
> > var pix=document.evaluate("//tr//a[contains
> > (@href,'#pic')]",document,null,6,null),i=0;
> > while(pik=pix.snapshotItem(i++))
> >   requestPic(pik.href);   //add images currently on the page
> >
> > var galleries=document.evaluate("//t...@colspan='8']/a",document,null,
> > 4,null); //get all other galleries
> > while(gallery=galleries.iterateNext().href)
> > GM_xmlhttpRequest({
> >        method: "GET",
> >        url:gallery,
> >        onload:function(a)
> >        {
> >          addImg(a.responseText);      // add the image on the first page
> >          var pics=a.responseText.match(/\/.+#pic/g), i=0,
> > base=location.protocol+"//"+location.host;
> >
> >          while(pic=pics[i++])              // lookup other images within
> the
> >                requestPic(base+pic);       // gallery of this loop.
> >        }
> > })
> >
> >
> >
> >
> > you see where i changed it to what u said right? whats the problem
> > with this thing! i just hate when things wont work! lol thanks again
> > for all your help... maybe when things update it will work for me!
> >
> > On Nov 16, 12:32 am, esquifit <[email protected]> wrote:
> >> 1) Install the script athttp://userscripts.org/scripts/show/37446
> >> 2) Change the said line to
> >>     link.href=/class=big src=(\S+)/.exec(text)[1];
> >> 3) Check the monkey is enabled (not greyed out) (It should be the case
> >> if you has been able to install the script)
> >> 4) Go to
> >>    http://imgsrc.ru/barabashka/a315405.html
> >> 5) Scroll down up to the bottom of the screen. You must see a list of
> links like
> >>
> >> DSC00792.JPG
> >> DSC00804.JPG
> >> DSC00757.JPG
> >> ...
> >>
> >> It is not necessary for javascript to be enable in the page for the
> >> script to work. If it still doesn't run, it is probably a problem with
> >> your Greasemonkey installation or another thing.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<greasemonkey-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=.


Reply via email to