It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
mrkgnao: I would use another operator (e.g. & or ^ or #).

As for parsing order, I recommend you go simple and always process left to right, so:
- A or B and C is (A or B) and C
- A and B or C is (A and B) or C
- A and B or C and D is ((A and B) or C) and D
Not very intuitive to new users but probably easier to implement and good enough.
Based on my experience, I assume this is easiest, but if there's something easier, go for it instead.

P.S. The AND operator is a nice-to-have. Not urgent at all.
avatar
adaliabooks: At the moment I just split the search term on ; and then loop through the array of the results and filter for each term... the easiest would be to split on ; for OR first and then split again for AND... but the logic may not make much sense that way.
So to use your examples it would be:
- A or B and C is A or (B and C)
- A and B or C is (A and B) or C
- A and B or C and D is (A and B) or (C and D)

But I'll have a think about it.
I don't exactly understand your description, but the examples you quote are the best possible, as they follow the natural logic of giving precedence to AND over OR. But do whatever is easiest, if at all. As long as it's well defined and predictable, I expect people will be grateful.

As for the bug (unable to perform thread search). For me, it's still there. Cannot perform any thread search. Tried disabling BE and exiting FF altogether. Didn't help. No idea how to progress.
avatar
mrkgnao: I don't exactly understand your description, but the examples you quote are the best possible, as they follow the natural logic of giving precedence to AND over OR. But do whatever is easiest, if at all. As long as it's well defined and predictable, I expect people will be grateful.

As for the bug (unable to perform thread search). For me, it's still there. Cannot perform any thread search. Tried disabling BE and exiting FF altogether. Didn't help. No idea how to progress.
Well I think that way should be reasonably easy, so I'll give it a shot.

Hmm... any errors at all?
What's actually happening? Is it clearing the thread and stopping there? Not returning any results but giving the No Results bit?
avatar
adaliabooks: What's actually happening? Is it clearing the thread and stopping there? Not returning any results but giving the No Results bit?
Clearing the thread and stopping there.

Is there a debugger for Greasemonkey scripts?
avatar
mrkgnao: Clearing the thread and stopping there.

Is there a debugger for Greasemonkey scripts?
I'm not sure, I generally just put in a load of console.log() functions when I break something...
So the forum search is still working?
It definitely looks like a problem with the AJAX requests but I'm not sure why it's working for me and not you...
avatar
mrkgnao: Clearing the thread and stopping there.

Is there a debugger for Greasemonkey scripts?
avatar
adaliabooks: I'm not sure, I generally just put in a load of console.log() functions when I break something...
So the forum search is still working?
It definitely looks like a problem with the AJAX requests but I'm not sure why it's working for me and not you...
Forum search is fine.
I'll let you mull it over and see if you can think what change could have caused this. If you want me to try some things (e..g make some local edits and test), I will gladly.
If someone else is reading this (am I the only one using this wonderful tool?), please report whether it works for you.
avatar
mrkgnao: Forum search is fine.
I'll let you mull it over and see if you can think what change could have caused this. If you want me to try some things (e..g make some local edits and test), I will gladly.
If someone else is reading this (am I the only one using this wonderful tool?), please report whether it works for you.
Well, if you don't mind and can be bothered... might as well see where it's getting to and why it's hanging...

Make sure you've got the most recent version so the line numbers are right, and then add some console.log()s in.
I'll list the line number where to put the edit and the edit. If the line number listed has something on it, just move it to the next line and put the edit on the new blank line. (the later line numbers should reflect the new lines added)

104 : console.log('Forum');
109 : console.log('Thread');
159 : console.log('AJAX Complete');
173 : console.log('Within Results');
178 : console.log('Normal Search');
300 : console.log(i);

That should hopefully catch something in the console when you run it..
avatar
mrkgnao: Forum search is fine.
I'll let you mull it over and see if you can think what change could have caused this. If you want me to try some things (e..g make some local edits and test), I will gladly.
If someone else is reading this (am I the only one using this wonderful tool?), please report whether it works for you.
avatar
adaliabooks: Well, if you don't mind and can be bothered... might as well see where it's getting to and why it's hanging...

Make sure you've got the most recent version so the line numbers are right, and then add some console.log()s in.
I'll list the line number where to put the edit and the edit. If the line number listed has something on it, just move it to the next line and put the edit on the new blank line. (the later line numbers should reflect the new lines added)

104 : console.log('Forum');
109 : console.log('Thread');
159 : console.log('AJAX Complete');
173 : console.log('Within Results');
178 : console.log('Normal Search');
300 : console.log(i);

That should hopefully catch something in the console when you run it..
Wasn't difficult.

Did a "mount" search in the "what did just update?" thread with first page = 198.
Got:
198 gm_script:300:9
199 gm_script:300:9
"Normal Search" gm_script:178:1
Error: Permission denied to access property "nodeType" _min_global.ed4dfb14.js:22:2873



Also before I ran the script, when I just opened the thread page, I got:
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. _min_global.ed4dfb14.js:15:0
"Invalid App Id: Must be a number or numeric string representing the application id." all.js:64:239
"FB.getLoginStatus() called before calling FB.init()." all.js:64:239



BTW, you might want to publish your script with the log prints included, but simply commented out, so people can comment them in to debug.
avatar
mrkgnao: Wasn't difficult.

Did a "mount" search in the "what did just update?" thread with first page = 198.
Got:
198 gm_script:300:9
199 gm_script:300:9
"Normal Search" gm_script:178:1
Error: Permission denied to access property "nodeType" _min_global.ed4dfb14.js:22:2873

Also before I ran the script, when I just opened the thread page, I got:
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. _min_global.ed4dfb14.js:15:0
"Invalid App Id: Must be a number or numeric string representing the application id." all.js:64:239
"FB.getLoginStatus() called before calling FB.init()." all.js:64:239

BTW, you might want to publish your script with the log prints included, but simply commented out, so people can comment them in to debug.
That's not a bad idea, I'll go through and put some logging stuff in where ever there might be problems and then people can just uncomment out any relevant ones when debugging.

Anyway, when I do the same search I get
Thread
then the errors about Facebook
Normal Search
A list of numbers from 198 till 496 (which is just the page numbers)
And then AJAX Complete 199 times.

I'm not sure the nodeType error is anything to do with it, that seems to be GoG related but I'll check it out. Not entirely sure but the AJAX completes don't seem to be firing, so whether the requests never went in the first place or whether they're going but then crashing I'm not sure...
It doesn't look like it's going more than 2 pages either...
How odd...

Edit: Oh, and thanks for taking the time to do this, much appreciated :)
Post edited August 05, 2015 by adaliabooks
avatar
adaliabooks: That's not a bad idea, I'll go through and put some logging stuff in where ever there might be problems and then people can just uncomment out any relevant ones when debugging.

Anyway, when I do the same search I get
Thread
then the errors about Facebook
Normal Search
A list of numbers from 198 till 496 (which is just the page numbers)
And then AJAX Complete 199 times.

I'm not sure the nodeType error is anything to do with it, that seems to be GoG related but I'll check it out. Not entirely sure but the AJAX completes don't seem to be firing, so whether the requests never went in the first place or whether they're going but then crashing I'm not sure...
It doesn't look like it's going more than 2 pages either...
How odd...

Edit: Oh, and thanks for taking the time to do this, much appreciated :)
I use the "50 posts per page" setting (not 20). Page 199 is the last page of the thread for me (not 496). It was supposed to run from 198 to 199.
Post edited August 05, 2015 by mrkgnao
avatar
mrkgnao: I use the "50 posts per page" setting (not 20). Page 199 is the last page for me (not 496). It was supposed to run from 198 to 199.
Ah, that explains that at least.
I changed my settings and tried again, just to see if that has anything to do with it, and I get the same console output, but turn up five results... so posts per page doesn't seem to be a problem
And the AJAX complete bit wouldn't happen because it only happens if there are a lot of requests as its part of the queuing system (which obviously isn't the case if its only searching two pages)
I can't see why it wouldn't be working... certainly if the forum search works and there are no errors coming up...
I'll come back to this tomorrow..
In the meantime, if anyone else is using the script it would be good to know if it's working or not for you... I'm presuming as it works for me this might be isolated to mrkgnao in particular for some reason, but it might not be.
avatar
mrkgnao: I use the "50 posts per page" setting (not 20). Page 199 is the last page for me (not 496). It was supposed to run from 198 to 199.
avatar
adaliabooks: Ah, that explains that at least.
I changed my settings and tried again, just to see if that has anything to do with it, and I get the same console output, but turn up five results... so posts per page doesn't seem to be a problem
And the AJAX complete bit wouldn't happen because it only happens if there are a lot of requests as its part of the queuing system (which obviously isn't the case if its only searching two pages)
I can't see why it wouldn't be working... certainly if the forum search works and there are no errors coming up...
I'll come back to this tomorrow..
In the meantime, if anyone else is using the script it would be good to know if it's working or not for you... I'm presuming as it works for me this might be isolated to mrkgnao in particular for some reason, but it might not be.
OK. I tried the 20 setting and it didn't help.
avatar
mrkgnao: OK. I tried the 20 setting and it didn't help.
Just tried it in Firefox to see if that might be the issue (I seem to remember you use Firefox) but the script and thread search seem to work fine if just pasted into the console and run that way...
I'll keep thinking about it, going to bed now but hopefully might be able to get it sorted tomorrow...
avatar
adaliabooks: Just tried it in Firefox to see if that might be the issue (I seem to remember you use Firefox) but the script and thread search seem to work fine if just pasted into the console and run that way...
I'll keep thinking about it, going to bed now but hopefully might be able to get it sorted tomorrow...
In-thread searching has been rather inconsistent for me since a couple of versions back (sometimes it works as should, sometimes it just sits there doing nth/ returning no results or messages), but I can confirm that it does always work as intended when used that way.

Tested the latest version (0.4.4) in this very thread, searching for "JMich; mrkgnao", got the "Sorry, no results blah blah blah" message, run the same search using the console, got results just fine.

I'm also on Firefox 39.0
avatar
HypersomniacLive: In-thread searching has been rather inconsistent for me since a couple of versions back (sometimes it works as should, sometimes it just sits there doing nth/ returning no results or messages), but I can confirm that it does always work as intended when used that way.

Tested the latest version (0.4.4) in this very thread, searching for "JMich; mrkgnao", got the "Sorry, no results blah blah blah" message, run the same search using the console, got results just fine.

I'm also on Firefox 39.0
Ok, that's interesting to know... Thanks Hyper.
Do you get any errors when it fails? I'll have a think about why it might work when pasted in and run but not straight from the script..
Might have to do some more testing in Firefox and see if it's browser specific...
Can you remember which version started causing problems? That might help pinpoint the issue if I can see what I changed for that version...
I'm having a feeling it might be to do with my AJAX queuing system, as, quite frankly, I was some what surprised that it worked at all and wouldn't be shocked to find it has errors in it...
avatar
adaliabooks: Ok, that's interesting to know... Thanks Hyper.
Do you get any errors when it fails? I'll have a think about why it might work when pasted in and run but not straight from the script..
Might have to do some more testing in Firefox and see if it's browser specific...
Can you remember which version started causing problems? That might help pinpoint the issue if I can see what I changed for that version...
I'm having a feeling it might be to do with my AJAX queuing system, as, quite frankly, I was some what surprised that it worked at all and wouldn't be shocked to find it has errors in it...
No errors or other messages, it appears to be doing nth after I hit the Enter key and all the posts vanish.

Oddly enough, I just tested it in the mafia game thread and it worked just fine.


I remember that I had this issue from v0.4.1 onwards, but I'm not sure if that was the very first one. :/

And I don't know if it matters, but I'm also using the 50posts/page setting.