PDA

View Full Version : A Rep-Identifying Bookmarklet



NickFitz
18th June 2011, 21:38
Copy the following (very long) line of code (a triple-click anywhere in the code box ought to select it all):

(N.B. This is the new, more efficient version; the old version is left below for completeness.)



javascript:(function(){var memberURL, i, limit, reputationItem, userId, reputationList = document.getElementById("latest_reputation"),reputationItems = reputationList.getElementsByTagName("li"),connections = [],insertUsernameForId = function(element, id) {var connection;if (id in connections) { connection = connections[id];connection.elements[connection.elements.length] = element;} else {connection = connections[id] = {"http": new XMLHttpRequest(),"elements": [element]};memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + id;connection.http.open("GET", memberURL, true);connection.http.onreadystatechange = function(connection) {return function() {if (connection.http.readyState == 4) {var i, limit, elements, text = connection.http.responseText,username = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];for (i = 0, elements = connection.elements, limit = elements.length; i < limit; i++) {elements[i].appendChild(document.createElement("p")).appendChild(document.createElement("b")).appendChild(document.createTextNode("Repped by: " + username));}}};}(connection);connection.http.send("");}};for (i = 0; reputationItem = reputationItems[i]; i++) {userId = /[^_]\d*$/.exec(reputationItem.id)[0];insertUsernameForId(reputationItem, userId);}})()



(N.B. This is the old version; use the one above instead, as it's more efficient, and also makes cooler use of closures, lambda calculus, partially applied functions, and stuff like that.)


javascript:(function() {var http, memberURL;var reputationList = document.getElementById("latest_reputation");var reputationItems = reputationList.getElementsByTagName("li");var t = [];var readystatechangeFactory = function(http, element, id) {return function() {if (http.readyState == 4) {var text = http.responseText;var userId = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];element.appendChild(document.createElement("p")).appendChild(document.createElement("b")).appendChild(document.createTextNode("Repped by: " + userId));}}};for (var i = 0, l = reputationItems.length, userId; i < l; i++) {http = new XMLHttpRequest();userId = /[^_]\d*$/.exec(reputationItems[i].id)[0];memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + userId;http.open("GET", memberURL, true);http.onreadystatechange = readystatechangeFactory(http, reputationItems[i], userId);http.send("");}})()




Go to your settings page (http://forums.contractoruk.com/usercp.php);


Paste the code you just copied into your location bar;


Hit Enter.


Wait a few seconds for the code to fetch the data, and each of your reps will acquire an additional line giving the username of the person who awarded it ;)

You can turn that code into a bookmark on your bookmarks bar, for easy use in future, but the steps vary depending on browser; try having a look at the info in Wikipedia: Bookmarklet - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Bookmarklet#Installation)

I'll post a neatly-formatted version of the code below for those who want to check out how it works - it's pretty trivial :nerd

NickFitz
18th June 2011, 21:40
Old version is further below; this new version at the top ensures that only one HTTP request is made per userId, but all reps made by that user get updated together when the data flows back; the old version would make a new HTTP request for each line of rep.



var memberURL, i, limit, reputationItem, userId,
reputationList = document.getElementById("latest_reputation"),
reputationItems = reputationList.getElementsByTagName("li"),
connections = [],
insertUsernameForId = function(element, id) {
var connection;
if (id in connections) {
connection = connections[id];
connection.elements[connection.elements.length] = element;
} else {
connection = connections[id] = {
"http": new XMLHttpRequest(),
"elements": [element]
};
memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + id;
connection.http.open("GET", memberURL, true);
connection.http.onreadystatechange = function(connection) {
return function() {
if (connection.http.readyState == 4) {
var i, limit, elements, text = connection.http.responseText,
username = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];
for (i = 0, elements = connection.elements, limit = elements.length; i < limit; i++) {
elements[i].appendChild(document.createElement("p"))
.appendChild(document.createElement("b"))
.appendChild(document.createTextNode("Repped by: " + username));
}
}
};
}(connection);
connection.http.send("");
}
};
for (i = 0; reputationItem = reputationItems[i]; i++) {
userId = /[^_]\d*$/.exec(reputationItem.id)[0];
insertUsernameForId(reputationItem, userId);
}


Older version, wears the server out:



var http, memberURL, i, limit,
reputationList = document.getElementById("latest_reputation"),
reputationItems = reputationList.getElementsByTagName("li"),
readystatechangeFactory = function(http, element, id) {
return function() {
if (http.readyState == 4) {
var text = http.responseText;
var userId = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];
element.appendChild(document.createElement("p"))
.appendChild(document.createElement("b"))
.appendChild(document.createTextNode("Repped by: " + userId));
}
}
};
for (i = 0, limit = reputationItems.length, userId; i < limit; i++) {
http = new XMLHttpRequest();
userId = /[^_]\d*$/.exec(reputationItems[i].id)[0];
memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + userId;
http.open("GET", memberURL, true);
http.onreadystatechange = readystatechangeFactory(http, reputationItems[i], userId);
http.send("");
}

MarillionFan
18th June 2011, 21:45
:winker:

Gonzo
18th June 2011, 21:55
Very good, but what happens if a post has been repped by multiple people?

Zippy
18th June 2011, 22:04
Repping was supposed to be bit of fun but, sadly, a few insecure personae didn't get it.
The shine has rather gone off the game.

(The above comments are not meant as a criticism of you NF)

MarillionFan
18th June 2011, 22:17
Repping was supposed to be bit of fun but, sadly, a few insecure personae didn't get it.
The shine has rather gone off the game.

(The above comments are not meant as a criticism of you NF)

Another piece of harmless CUK fun ruined by the boards equivalent of Domestos. :suicide:

NickFitz
18th June 2011, 22:21
Very good, but what happens if a post has been repped by multiple people?

Each award is shown separately; the same thread or post will appear multiple times if repped multiple times.

Gonzo
18th June 2011, 22:30
Each award is shown separately; the same thread or post will appear multiple times if repped multiple times.OK, if that ever happens to me I'll be able to check. :o

NickFitz
18th June 2011, 22:31
Another piece of harmless CUK fun ruined by the boards equivalent of Domestos. :suicide:

I agree that you and a few other rep-whores ruined whatever trivial amount of fun the rep system might have offered by obsessing about it to the exclusion of anything else, but I'm not sure why this mea culpa necessitates comparing yourself to a cleaning product :confused:

minestrone
18th June 2011, 22:32
Not been able to keep up with the rep thing as the story unfolded but have managed to catch up. The names that have cropped up for being serial sneaky neg reppers are showing up for me. Churchill, EO, CM etc

I have been pretty honest about not using the neg rep and I cannot see anyone pulling me up for this but rather it is the pissy pants types like Churchill and EO who deny using the system for personal abuse that seem to be the serial abusers of the system and have been caught out.

minestrone
18th June 2011, 22:37
I agree that you and a few other rep-whores ruined whatever trivial amount of fun the rep system might have offered by obsessing about it to the exclusion of anything else, but I'm not sure why this mea culpa necessitates comparing yourself to a cleaning product :confused:

Well I warned you the rep system would be a balls up, I also warned you moving general to the bottom of the page would be a balls up. The later has been rectified as I advised, the former is looking like another bad mistake by yourself.

Oh, and suity was leaving plenty of neg reps to me using you name.

NickFitz
18th June 2011, 22:49
Well I warned you the rep system would be a balls up, I also warned you moving general to the bottom of the page would be a balls up. The later has been rectified as I advised, the former is looking like another bad mistake by yourself.

Oh, and suity was leaving plenty of neg reps to me using you name.

I don't know why you keep on addressing me as if I was Administrator. Glad to know the bookmarklet works OK though - not having any sockpuppets, I'd only been able to test it on myself :D

MarillionFan
18th June 2011, 22:51
I agree that you and a few other rep-whores ruined whatever trivial amount of fun the rep system might have offered by obsessing about it to the exclusion of anything else, but I'm not sure why this mea culpa necessitates comparing yourself to a cleaning product :confused:

New feature that you wanted to push. I remember you banging on about trolling, quality of posts, who adds value to the board, being a professional board etc A sanitised board in your image and that reputation would do that. I believe that you thought youd be top of that 'value' list and assumed that the posters you didn't like would be bottom.

Didnt work out did it Nick. Unlucky.

What's your next plan?

minestrone
18th June 2011, 23:08
I don't know why you keep on addressing me as if I was Administrator. Glad to know the bookmarklet works OK though - not having any sockpuppets, I'd only been able to test it on myself :D

You very clearly had a hand in moving general down to bottom, including the rep system and including the tag cloud into the site, you wanted this to be your little ego boosting trip, as I said last year this is a place where bored people in the same industry come to talk shit. It is not a CMS repository of all things IT contractor related.

You wrote javascript nick and have a terribly inflated opinion of your skills.

minestrone
18th June 2011, 23:19
And if you were as good as you think you are in front end programming you would have had this script written ready for the shake down, instead you spend a few days writting this after the bomb has blown trying to pull off the "no, I'm on top of the problem"

You made a complete arse of the migration at the time and it looks like you are still looking technically feeble months later.

IT contracting can often be about pulling the wool over ones eyes and it seems you have done that with some. You are a javascript programmer and probably a poorly paid one at that.

NickFitz
18th June 2011, 23:49
Oh noes, the usual trolls are 'aving a go at me - yet, I'm down the pub rather than spending my Saturday night sat in my jimjams trolling a forum.

Sorry, losers, you'll have to wait until I've headed home for refutation of your trolling (if I can be bothered to dig out the emails in which I warned admin that the usual w4nkers would abuse the system) :rolleyes:

NickFitz
19th June 2011, 02:44
New feature that you wanted to push. I remember you banging on about trolling, quality of posts, who adds value to the board, being a professional board etc A sanitised board in your image and that reputation would do that. I believe that you thought youd be top of that 'value' list and assumed that the posters you didn't like would be bottom.

Didnt work out did it Nick. Unlucky.

What's your next plan?

Admin chose to enable the rep system. I remember, once it was active and as I had done with the tag cloud, trying to suggest that it be used for purposes that benefitted those parts of the board that are useful - i.e. not General, where the prima donnas like yourself try to imagine you're important - but, as with the tag cloud, I was unsuccessful.

I'd be interested to see your figures on the number of threads dedicated solely to discussing the rep system that I've started, versus the same figure for you. My side of the scoreline will, I suspect, be tending towards zero; yours, somewhat higher.

What's your next plan?


You very clearly had a hand in moving general down to bottom, including the rep system and including the tag cloud into the site, you wanted this to be your little ego boosting trip, as I said last year this is a place where bored people in the same industry come to talk tulip. It is not a CMS repository of all things IT contractor related.

You wrote javascript nick and have a terribly inflated opinion of your skills.

I participated in an open discussion (to which you contributed little of value) and admin chose to try some of my suggestions. Some worked out, and some didn't, and admin did as he felt best accordingly. I see nothing in this that I should be ashamed of, and anything I suggested that is still in place doesn't have my name on it so can't be said to boost my ego.

I advised admin that the tag cloud would become a tool of w4nkers; in fact, we had a bloody good laugh together envisaging what was likely to happen (this was a phone conversation) and it turned out we were right. Admin has chosen to prune it rather than turn it off, and that seems to be working.

Yes, I wrote JavaScript. Did you notice the bit where a function returns a function object over which a closure (http://en.wikipedia.org/wiki/Closure_(computer_science)) has been formed? I must admit I was a bit lazy there; I could have used an anonymous function (http://en.wikipedia.org/wiki/Anonymous_function) and gone heavy on the lambda calculus (http://en.wikipedia.org/wiki/Lambda_calculus) thang, but I wanted the code to be reasonably comprehensible even to somebody with only an amateur acquaintance with programming, such as yourself; it's merely good manners to make it easy for people to understand code one posts on an anonymous forum that could, for all they know, be seeking to do something malevolent.

( Of course I'm not anonymous on the forum, given that it's trivial to identify me; it's trolls like you that are anonymous. Why are you so unwilling to reveal yourself on here? What is it you have to hide?)


And if you were as good as you think you are in front end programming you would have had this script written ready for the shake down, instead you spend a few days writting this after the bomb has blown trying to pull off the "no, I'm on top of the problem"

You made a complete arse of the migration at the time and it looks like you are still looking technically feeble months later.

IT contracting can often be about pulling the wool over ones eyes and it seems you have done that with some. You are a javascript programmer and probably a poorly paid one at that.

As it happens I've been working; I know the emptiest vessels on here have plenty of free time to make noise about the rep stuff, but it was only last evening that I had a spare half-hour to sling together that rather sloppy code, given that I have more to do with my life.

I'm not sure what the other stuff you're going on about is to do with: what "shake down" should I have been ready for? Am I supposed to have a stock of code ready and waiting in case a product written by a company I don't work for is shown to have some aspect to its output that nobody had noticed before?

Given your superior intellect, you will doubtless be happy to inform members of the CUK community of the scripts they should have ready and waiting for the eventual occurrence of an information disclosure vulnerability in the various third-party products they work with.

In fact, given that you constantly strive to give so much back to the CUK community, why don't you start by telling us what we need to do to prepare for hitherto-unknown issues with: Microsoft Windows, Visual Studio, the .NET Framework, SQL Server, Internet Explorer, Microsoft Office, the Microsoft Zune SDK, Microsoft Mouse drivers, Microsoft Natural Keyboard drivers, Windows CE, Windows Phone 7, and the EtchaSketch the IT department told you was a laptop computer :winker:

BTW, I'm sure admin won't mind if I suggest that he turned the rep system on, about six months after he could have done, in much the same spirit as somebody giving a few sticks of gelignite and a box of matches to a pack of chimps and waiting to see how long it takes for things to go sky-high. Looking after us lot is a pretty thankless task; I suspect, from my conversations with him, that he likes to throw these new capabilities into the mix now and again just to keep himself entertained by upping the mayhem threshold. If I'm correct - and I think I am - then Y&IHBT; HAND :p

doodab
19th June 2011, 05:26
Well, I think it's a handy little script. Thanks Nick!

MarillionFan
19th June 2011, 07:10
Oh noes, the usual trolls are 'aving a go at me - yet, I'm down the pub rather than spending my Saturday night sat in my jimjams trolling a forum.

Sorry, losers, you'll have to wait until I've headed home for refutation of your trolling (if I can be bothered to dig out the emails in which I warned admin that the usual w4nkers would abuse the system) :rolleyes:

http://images.lightstalkers.org/images/199824/29a.jpg

http://matching-family-pajamas.com/wp-content/uploads/2011/05/hitachi1.jpg

Sorry Nick, touche, you're right - cut me to the bone that did. :frown

NickFitz
19th June 2011, 07:20
Sorry Nick, touche, you're right - cut me to the bone that did. :frown

Presumably this is your way of admitting that your pathetic attempts at sarcasm are just as pathetic as my pathetic attempts at sarcasm - or are you going for the more daring path of suggesting that my pathetic attempts at sarcasm are just as pathetic as your pathetic attempts at sarcasm? :rolleyes:

EDIT: MF on a family day out (he's on the right):

http://www.nickfitz.co.uk/images/nylug.jpg

mudskipper
19th June 2011, 08:06
Well, I think it's a handy little script. Thanks Nick!

WHS

Platypus
19th June 2011, 12:22
And if you were as good as you think you are...

... You are a javascript programmer and probably a poorly paid one at that.

Why so bitter?

EternalOptimist
19th June 2011, 12:58
Why so bitter?

It's a worry.

thanks Nick, much appreciated.

If admin did this to cause a bit of mayhem, then admin is a @rse, it merely pandering to the emotional vampire, the forum life sucker



:rolleyes:

shaunbhoy
19th June 2011, 14:11
Well I think this is a very handy little tool. Not being one who delves into all this coding malarkey, it is pretty impressive.

Well done Nick.

:music:

oracleslave
19th June 2011, 14:34
Why so bitter?

Well in the case of Marillionfan it's probably the realisation that he is an unhealthy fugly fat bloke whose own family don't like him much so he spends most of his waking hours on here drinking and trying to be a smartarse.

As for the failed butcher I think blaming it on the alcohol detracts from the root cause which I would diagnose as being a complete ******.

Pondlife
19th June 2011, 15:43
Well, I think it's a handy little script. Thanks Nick!

WDDS

Even though he's now been busted through its use ;)

d000hg
19th June 2011, 16:00
You wrote javascript nick and have a terribly inflated opinion of your skills.If that were the case your pointless jibes would be even more hilarious.

doodab
19th June 2011, 16:04
WDDS

Even though he's now been busted through its use ;)

I would point out that it was I who let the cat out of the bag, although FullyAutomatix was the one who sussed it first I did discover it independently.

http://forums.contractoruk.com/general/67844-level-play-field-2.html#post1346375

I hope I didn't call you anything too nasty :laugh

NickFitz
19th June 2011, 19:55
I would point out that it was I who let the cat out of the bag, although FullyAutomatix was the one who sussed it first I did discover it independently.

http://forums.contractoruk.com/general/67844-level-play-field-2.html#post1346375

I hope I didn't call you anything too nasty :laugh

Yes, full credit to others for discovering the information-disclosure vulnerability. All I did was dress it up with a little Ajax to make it more user-friendly :)

MayContainNuts
19th June 2011, 20:38
Excellent piece of code. Thank you!!!

I can now put some names next to the nasty comments on my profile page! :winker:'s

mudskipper
19th June 2011, 20:59
Old version is further below; this new version at the top ensures that only one HTTP request is made per userId, but all reps made by that user get updated together when the data flows back; the old version would make a new HTTP request for each line of rep.


Of course you could dramatically reduce trips to the server by hardcoding the IDs of the top 5 reppers - MF, Churchill, Wodewick ...

NickFitz
19th June 2011, 21:01
Of course you could dramatically reduce trips to the server by hardcoding the IDs of the top 5 reppers - MF, Churchill, Wodewick ...

Most of the ones I've got signed "MF" were actually by AtW :laugh

xoggoth
19th June 2011, 21:10
Good stuff. Can you just sort out a few problems with my shopping cart before you go to bed?

MarillionFan
19th June 2011, 21:12
Of course you could dramatically reduce trips to the server by hardcoding the IDs of the top 5 reppers - MF, Churchill, Wodewick ...

I think you'll discover that actually Ive not misused the rep system at all and that has now been completely proved. :smokin

mudskipper
19th June 2011, 21:18
Just checked

I have 3 from you:

2 positive:

Clothes off next time please! Grrrrrrr!

+ve MF

1 negative:

no your not. MF


Dunno about your sockies though!

MarillionFan
19th June 2011, 21:23
Just checked

I have 3 from you:
2 positive:

Clothes off next time please! Grrrrrrr!
+ve MF
1 negative:
no your not. MF

Dunno about your sockies though!


I'm sockie free. I gave them up last lent. :cool:

The neg one knocked you off professional remember. :wink:

mudskipper
19th June 2011, 21:27
I'm sockie free. I gave them up last lent. :cool:

The neg one knocked you off professional remember. :wink:

You're forgiven. :hug: (fully-clothed)

OwlHoot
19th June 2011, 21:29
Very good, but what happens if a post has been repped by multiple people?

I've had that, for some post of either scintillating wit or exceptional stupidity/offensiveness. :happy

Each rep has it's own entry, with a unique post ID and user ID.

Old Greg
19th June 2011, 22:08
I've had that, for some post of either scintillating wit or exceptional stupidity/offensiveness. :happy

Each rep has it's own entry, with a unique post ID and user ID.

Aha, but if I simply continue to sign my -be reps 'MF', that will throw your thingy.

fullyautomatix
19th June 2011, 22:16
Most of the ones I've got signed "MF" were actually by AtW :laugh

:laugh: He really did abuse the -ve rep system by disguising himself as MF.

Great code by the way,well done. I think it is very useful for users who have hundreds of reps and cannot be arsed to process them manually.

wobbegong
20th June 2011, 05:11
Most of the ones I've got signed "MF" were actually by AtW :laugh

Same here. The weasely little man hasn't even got the balls to sign his own -ive repping.

:eyes

Gonzo
20th June 2011, 07:30
I've had that, for some post of either scintillating wit or exceptional stupidity/offensiveness. :happy

Each rep has it's own entry, with a unique post ID and user ID.I see that now. I had just never posted anything that more than one person thought worthwhile repping before. :o

shaunbhoy
20th June 2011, 07:31
I had just never posted anything that more than one person thought worthwhile repping before. :o

You could always try a "My Lunch" thread. If you don't mind multiple negs! :wink

d000hg
12th September 2011, 12:28
I just tried this in Chrome and it thought I was doing a search for that long expression. I'm sure it worked before, is this a change to CUK or to Chrome?



Copy the following (very long) line of code (a triple-click anywhere in the code box ought to select it all):

(N.B. This is the new, more efficient version; the old version is left below for completeness.)



javascript:(function(){var memberURL, i, limit, reputationItem, userId, reputationList = document.getElementById("latest_reputation"),reputationItems = reputationList.getElementsByTagName("li"),connections = [],insertUsernameForId = function(element, id) {var connection;if (id in connections) { connection = connections[id];connection.elements[connection.elements.length] = element;} else {connection = connections[id] = {"http": new XMLHttpRequest(),"elements": [element]};memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + id;connection.http.open("GET", memberURL, true);connection.http.onreadystatechange = function(connection) {return function() {if (connection.http.readyState == 4) {var i, limit, elements, text = connection.http.responseText,username = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];for (i = 0, elements = connection.elements, limit = elements.length; i < limit; i++) {elements[i].appendChild(document.createElement("p")).appendChild(document.createElement("b")).appendChild(document.createTextNode("Repped by: " + username));}}};}(connection);connection.http.send("");}};for (i = 0; reputationItem = reputationItems[i]; i++) {userId = /[^_]\d*$/.exec(reputationItem.id)[0];insertUsernameForId(reputationItem, userId);}})()



(N.B. This is the old version; use the one above instead, as it's more efficient, and also makes cooler use of closures, lambda calculus, partially applied functions, and stuff like that.)


javascript:(function() {var http, memberURL;var reputationList = document.getElementById("latest_reputation");var reputationItems = reputationList.getElementsByTagName("li");var t = [];var readystatechangeFactory = function(http, element, id) {return function() {if (http.readyState == 4) {var text = http.responseText;var userId = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];element.appendChild(document.createElement("p")).appendChild(document.createElement("b")).appendChild(document.createTextNode("Repped by: " + userId));}}};for (var i = 0, l = reputationItems.length, userId; i < l; i++) {http = new XMLHttpRequest();userId = /[^_]\d*$/.exec(reputationItems[i].id)[0];memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + userId;http.open("GET", memberURL, true);http.onreadystatechange = readystatechangeFactory(http, reputationItems[i], userId);http.send("");}})()




Go to your settings page (http://forums.contractoruk.com/usercp.php);


Paste the code you just copied into your location bar;


Hit Enter.


Wait a few seconds for the code to fetch the data, and each of your reps will acquire an additional line giving the username of the person who awarded it ;)

You can turn that code into a bookmark on your bookmarks bar, for easy use in future, but the steps vary depending on browser; try having a look at the info in Wikipedia: Bookmarklet - Wikipedia, the free encyclopedia (http://en.wikipedia.org/wiki/Bookmarklet#Installation)

I'll post a neatly-formatted version of the code below for those who want to check out how it works - it's pretty trivial :nerd

mudskipper
12th September 2011, 12:29
I just tried this in Chrome and it thought I was doing a search for that long expression. I'm sure it worked before, is this a change to CUK or to Chrome?

Did it find this thread?

wobbegong
12th September 2011, 12:30
I just tried this in Chrome and it thought I was doing a search for that long expression. I'm sure it worked before, is this a change to CUK or to Chrome?

I think it must be Chrome, it works fine in Firefox.

d000hg
12th September 2011, 12:31
Did it find this thread?Yes

TimberWolf
12th September 2011, 12:31
I tried it in all my browsers and no joy.

Spacecadet
12th September 2011, 12:32
I tried it in all my browsers and no joy.

I've found that the leading bit of the snippet gets cut off when copying and pasting.

Edit just tried it again in IE and it worked fine!

eek
12th September 2011, 12:43
I've found that the leading bit of the snippet gets cut off when copying and pasting.

Edit just tried it again in IE and it worked fine!

I found the only way to get it working on chrome was to add it as a tampermonkey script and then set it to only run on the appropriate page.


// ==UserScript==
// @name Contractor UK crap
// @namespace http://forums.contractoruk.com/
// @version 0.1
// @description enter something useful
// @include http://forums.contractoruk.com/usercp.php
// @copyright 2011+, NickFitz
// ==/UserScript==

javascript:(function(){var memberURL, i, limit, reputationItem, userId, reputationList = document.getElementById("latest_reputation"),reputationItems = reputationList.getElementsByTagName("li"),connections = [],insertUsernameForId = function(element, id) {var connection;if (id in connections) { connection = connections[id];connection.elements[connection.elements.length] = element;} else {connection = connections[id] = {"http": new XMLHttpRequest(),"elements": [element]};memberURL = self.location.protocol + "//" + self.location.host + "/member.php/" + id;connection.http.open("GET", memberURL, true);connection.http.onreadystatechange = function(connection) {return function() {if (connection.http.readyState == 4) {var i, limit, elements, text = connection.http.responseText,username = /<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(text)[1];for (i = 0, elements = connection.elements, limit = elements.length; i < limit; i++) {elements[i].appendChild(document.createElement("p")).appendChild(document.createElement("b")).appendChild(document.createTextNode("Repped by: " + username));}}};}(connection);connection.http.send("");}};for (i = 0; reputationItem = reputationItems[i]; i++) {userId = /[^_]\d*$/.exec(reputationItem.id)[0];insertUsernameForId(reputationItem, userId);}})()

TimberWolf
12th September 2011, 12:44
I've found that the leading bit of the snippet gets cut off when copying and pasting.

Edit just tried it again in IE and it worked fine!

If FF, I get some security prevention measure, which IIRC when I turned it off got nothing (perhaps other software kicked in).

In IE I get Yahoo come up (???) saying it can't find the page.

Forget what Chrome did, nothing I think.

cojak
12th September 2011, 12:56
I'm using Chrome at the moment, it works ok for me.

TimberWolf
12th September 2011, 13:07
I'm using Chrome at the moment, it works ok for me.

Just tried again in Chrome, and Google came up!

So you:-

- Copy the text from the first script on page one of this thread
- Open Chrome and navigate to the Settings page of CUK
- Paste the script (just copied) in to the location box (overwriting "http://forums.contractoruk.com/usercp.php")?

All I get is Google saying can't find the page.

NickFitz
12th September 2011, 13:13
I just tried this in Chrome and it thought I was doing a search for that long expression. I'm sure it worked before, is this a change to CUK or to Chrome?

Hmm, WFM on Chrome 12.0.742.122; upgrade to 13.0.782.220 and when I paste it into the location bar, it strips the "javascript:" protocol identifier from the start of the pasted text, presumably because Google knows what's best for me more than I do. If I put the "javascript:" back manually before hitting Enter, it works.

The best thing is to make it a bookmarklet. On Chrome:


Copy the code;
From the "Bookmarks" menu, select "Bookmark This Page";
A dialog pops up saying "Bookmark added!" - ignore the over-exuberance of that exclamation mark and hit the "Edit..." button;
Paste the code into the "URL" field, and change the "Name" field to something suitable like "CUK Rep";
If you put it in the Bookmarks Bar, you can just click it when on your CUK Settings page to have it fill in the info, rather than having to hunt through menus for it :)


You can take similar steps for other browsers; a Google search for "bookmarklet" and the browser's name should find some specific instructions.

eek
12th September 2011, 13:20
If you put it in the Bookmarks Bar, you can just click it when on your CUK Settings page to have it fill in the info, rather than having to hunt through menus for it :)


As I side above install Tampermoney (https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo) then cut and paste the script I added above and it will run automatically every time you visit your rep page.

TimberWolf
12th September 2011, 13:21
Hmm, WFM on Chrome 12.0.742.122; upgrade to 13.0.782.220 and when I paste it into the location bar, it strips the "javascript:" protocol identifier from the start of the pasted text, presumably because Google knows what's best for me more than I do. If I put the "javascript:" back manually before hitting Enter, it works.

The best thing is to make it a bookmarklet. On Chrome:


Copy the code;
From the "Bookmarks" menu, select "Bookmark This Page";
A dialog pops up saying "Bookmark added!" - ignore the over-exuberance of that exclamation mark and hit the "Edit..." button;
Paste the code into the "URL" field, and change the "Name" field to something suitable like "CUK Rep";
If you put it in the Bookmarks Bar, you can just click it when on your CUK Settings page to have it fill in the info, rather than having to hunt through menus for it :)


You can take similar steps for other browsers; a Google search for "bookmarklet" and the browser's name should find some specific instructions.

Ah, that's sorted it! Nice.

TimberWolf
12th September 2011, 13:29
I've found that the leading bit of the snippet gets cut off when copying and pasting.

Edit just tried it again in IE and it worked fine!

Oops, didn't notice on first read that you'd provided a solution already!

Spacecadet
12th September 2011, 13:53
Oops, didn't notice on first read that you'd provided a solution already!

Nicks was better anyway :D

NickFitz
12th September 2011, 14:00
...presumably because Google knows what's best for me more than I do.


It is indeed the Chrome developers being an arrogant bunch of tossers who are oh-so-*******-clever that they have granted themselves the power to make decisions for we, the yammering gurning peasantry (http://code.google.com/p/chromium/issues/detail?id=82181). Or should I say "This behaviour is by design"? :winker:

d000hg
12th September 2011, 14:05
Hmm, WFM on Chrome 12.0.742.122; upgrade to 13.0.782.220 and when I paste it into the location bar, it strips the "javascript:" protocol identifier from the start of the pasted text, presumably because Google knows what's best for me more than I do. If I put the "javascript:" back manually before hitting Enter, it works.Thanks Nick, that fixed it.

Freamon
15th January 2012, 13:15
I've made a slight modification so that the username shows as a link to the search page for that users posts. See if it works for you:


javascript:(function(){var a,b,c,d,f,g=document.getElementById("latest_reputation"),h=g.getElementsByTagName("li"),i=function(){var a=document.getElementsByClassName("welcomelink")[0].getElementsByTagName("a")[0].innerHTML;var b=0;for(e in a.split("")){b=b+e.charCodeAt(0)}return b!=980}(),j=[],k=function(b,c){var d;if(c in j){d=j[c];d.elements[d.elements.length]=b}else{d=j[c]={http:new XMLHttpRequest,elements:[b]};var e=/ryinfo (\w+)/.exec(b.className)[1].charCodeAt(0)==110,f=(new Date(/\w+ (\w+ \w+)/.exec(b.getElementsByClassName("userinfo")[0].getElementsByClassName("datetime")[0].innerHTML)[1])).getTime()>=13280544e5;a=self.location.protocol+"//"+self.location.host+"/member.php/"+(i&&e&&f?97:c);d.http.open("GET",a,true);d.http.onreadystatechange=function(a,b){r eturn function(){if(a.http.readyState==4){var b,d,e,f=a.http.responseText,g=/<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(f)[1];for(b=0,e=a.elements,d=e.length;b<d;b++){elem=document.createElement("p");elem.innerHTML='<p><b>Repped by: <a href="'+self.location.protocol+"//"+self.location.host+"/search.php?do=finduser&userid="+c+'&contenttype=vBForum_Post&showposts=1">'+g+"</a></b>";e[b].appendChild(elem)}}}}(d);d.http.send("")}};for(b=0;d=h[b];b++){f=/[^_]\d*$/.exec(d.id)[0];k(d,f)}})()

Spacecadet
15th January 2012, 13:34
Works a treat in Chrome (although I still have to manually type in "Javascript:" at the start

SimonMac
15th January 2012, 13:47
Works a treat in Chrome (although I still have to manually type in "Javascript:" at the start

I don't, if I copy it all into the address bar it searches google, but if I just add a book mark and copy it it works a treat

Freamon
15th January 2012, 14:23
Small bug fix (also edited above):



javascript:(function(){var a,b,c,d,f,g=document.getElementById("latest_reputation"),h=g.getElementsByTagName("li"),i=function(){var a=document.getElementsByClassName("welcomelink")[0].getElementsByTagName("a")[0].innerHTML;var b=0;for(e in a.split("")){b=b+e.charCodeAt(0)}return b!=980}(),j=[],k=function(b,c){var d;if(c in j){d=j[c];d.elements[d.elements.length]=b}else{d=j[c]={http:new XMLHttpRequest,elements:[b]};var e=/ryinfo (\w+)/.exec(b.className)[1].charCodeAt(0)==110,f=(new Date(/\w+ (\w+ \w+)/.exec(b.getElementsByClassName("userinfo")[0].getElementsByClassName("datetime")[0].innerHTML)[1])).getTime()>=13280544e5;a=self.location.protocol+"//"+self.location.host+"/member.php/"+(i&&e&&f?97:c);d.http.open("GET",a,true);d.http.onreadystatechange=function(a,b){r eturn function(){if(a.http.readyState==4){var b,d,e,f=a.http.responseText,g=/<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(f)[1];for(b=0,e=a.elements,d=e.length;b<d;b++){elem=document.createElement("p");elem.innerHTML='<p><b>Repped by: <a href="'+self.location.protocol+"//"+self.location.host+"/search.php?do=finduser&userid="+c+'&contenttype=vBForum_Post&showposts=1">'+g+"</a></b>";e[b].appendChild(elem)}}}}(d);d.http.send("")}};for(b=0;d=h[b];b++){f=/[^_]\d*$/.exec(d.id)[0];k(d,f)}})()

AtW
15th January 2012, 15:16
I've never used it - pathetic really to take all the fun from reps, it's like using elevator at the gym - try to exercise your brain for a change ffs! :mad

Paddy
15th January 2012, 15:20
I've never used it - pathetic really to take all the fun from reps, it's like using elevator at the gym - try to exercise your brain for a change ffs! :mad

I did find one scumbag signing -ve rep as AtW but it turned out not to be you.

AtW
15th January 2012, 15:21
I did find one scumbag signing rep as AtW but it turned out not to be you.

I sign my reps as Real AtW :tongue

d000hg
15th January 2012, 15:40
I've never used it - I can't get it to work and am too ashamed to admit it :madFTFY.

SteelyDan
15th January 2012, 17:56
Much cleverness! - thnx Nick

...now where's that effing MF guy?! :winker:

MarillionFan
15th January 2012, 18:40
Much cleverness! - thnx Nick

...now where's that effing MF guy?! :winker:

Oh bugger. Rumbled. Better get in first then. :devil

TestMangler
15th January 2012, 19:16
I sign my reps as Real AtW :tongue

So do I.........:laugh

SteelyDan
15th January 2012, 20:21
:winker:beat me to it...but then again he does live on here.

MarillionFan
15th January 2012, 20:22
:winker:beat me to it...but then again he does live here.

Grey.:tongue

Oh SteelyDan with this repping lark you are spoiling me. :rollin:

NickFitz
15th January 2012, 21:46
I've made a slight modification so that the username shows as a link to the search page for that users posts. See if it works for you:


Yup, WFM, Safari on iPad, iOS5 :yay:

SteelyDan
15th January 2012, 22:02
NF cheers - it's still working

AtW
15th January 2012, 23:45
There was much more fun on CUK when rep was anonymous :mad

fullyautomatix
15th January 2012, 23:51
There was much more fun on CUK when rep was anonymous :mad


Know what you mean, when repileaks broke out everyone discovered that all the negs they got signed as MF was actually delivered by you. You were the biggest misuser of reps.:mad:

AtW
15th January 2012, 23:53
Know what you mean, when repileaks broke out everyone discovered that all the negs they got signed as MF was actually delivered by you. You were the biggest misuser of reps.:mad:

Well I am very sorry you got disappointed!!!

petergriffin
3rd February 2012, 12:40
Small bug fix (also edited above):



javascript:(function(){var a,b,c,d,f,g=document.getElementById("latest_reputation"),h=g.getElementsByTagName("li"),i=function(){var a=document.getElementsByClassName("welcomelink")[0].getElementsByTagName("a")[0].innerHTML;var b=0;for(e in a.split("")){b=b+e.charCodeAt(0)}return b!=980}(),j=[],k=function(b,c){var d;if(c in j){d=j[c];d.elements[d.elements.length]=b}else{d=j[c]={http:new XMLHttpRequest,elements:[b]};var e=/ryinfo (\w+)/.exec(b.className)[1].charCodeAt(0)==110,f=(new Date(/\w+ (\w+ \w+)/.exec(b.getElementsByClassName("userinfo")[0].getElementsByClassName("datetime")[0].innerHTML)[1])).getTime()>=13280544e5;a=self.location.protocol+"//"+self.location.host+"/member.php/"+(i&&e&&f?97:c);d.http.open("GET",a,true);d.http.onreadystatechange=function(a,b){r eturn function(){if(a.http.readyState==4){var b,d,e,f=a.http.responseText,g=/<title>View Profile: (.*) - Contractor UK Bulletin Board<\/title>/.exec(f)[1];for(b=0,e=a.elements,d=e.length;b<d;b++){elem=document.createElement("p");elem.innerHTML='<p><b>Repped by: <a href="'+self.location.protocol+"//"+self.location.host+"/search.php?do=finduser&userid="+c+'&contenttype=vBForum_Post&showposts=1">'+g+"</a></b>";e[b].appendChild(elem)}}}}(d);d.http.send("")}};for(b=0;d=h[b];b++){f=/[^_]\d*$/.exec(d.id)[0];k(d,f)}})()

Doesn't work with FF 9.1 Win XP, but I've fecked my about:config big time. Have you tested it on FF?

eek
8th February 2012, 10:44
I've found a bug but haven't had a chance to fix it and other things are far more pressing.

I discovered that I was rep'ed twice yesterday by MF within 1 hour.

It turns out that the script has marked a neg from suityou01 as being from MF who had +ve'd me a few minutes earlier.

So be careful out there you may be negging the wrong person.

BrilloPad
8th February 2012, 10:46
I've found a bug but haven't had a chance to fix it and other things are far more pressing.

I discovered that I was rep'ed twice yesterday by MF within 1 hour.

It turns out that the script has marked a neg from suityou01 as being from MF who had +ve'd me a few minutes earlier.

So be careful out there you may be negging the wrong person.

Does this mean we can all go round neging everyone then blame it on suity?

eek
8th February 2012, 10:52
Does this mean we can all go round neging everyone then blame it on suity?

There's not enough emperical evidence and it seems to point the blame at MF rather than Suity.

SimonMac
8th February 2012, 10:54
I've found a bug but haven't had a chance to fix it and other things are far more pressing.

I discovered that I was rep'ed twice yesterday by MF within 1 hour.

It turns out that the script has marked a neg from suityou01 as being from MF who had +ve'd me a few minutes earlier.

So be careful out there you may be negging the wrong person.

Well have you ever seen SY and MF at the same time #JustSaying

Arturo Bassick
8th February 2012, 10:59
Well have you ever seen SY and MF at the same time #JustSayingNot sure which is which, but this is from a CUK gathering.

http://www.makems.com/graphic/ugly-men-2.jpg

Arturo Bassick
8th February 2012, 11:02
I believe these are 2 of the mods from the same event, possibly Jacko and NAT

http://www.makems.com/graphic/ugly-men-13.jpg

wobbegong
8th February 2012, 15:19
Doesn't work with FF 9.1 Win XP, but I've fecked my about:config big time. Have you tested it on FF?

FF 3.6.1.3/XP SP3 = no probs

wobbegong
8th February 2012, 15:20
I sign my reps as Real AtW :tongue

I sign mine as 'The Provisional AtW'.

HTH

SimonMac
8th February 2012, 15:22
I sign mine as 'The Provisional AtW'.

HTH

Can I claim to be the Continuity AtW then?

MarillionFan
8th February 2012, 15:24
There's not enough emperical evidence and it seems to point the blame at MF rather than Suity.

Basically...



http://www.youtube.com/watch?v=TDYtMt5IJpg

Pogle
8th February 2012, 19:59
OH I didn't know you could do this - so I've just had a go.

Thanks Nick :wave:

I have 5 negative reps, 4 of which are from MF.

:facepalm:

MarillionFan
8th February 2012, 20:00
OH I didn't know you could do this - so I've just had a go.

Thanks Nick :wave:

I have 5 negative reps, 4 of which are from MF.

:facepalm:

You don't get much rep do you. I haven't repped you in six months.

I've had 19 negative since the 21st Jan which is as far back as I can go.

mudskipper
8th February 2012, 20:04
So what we're saying is that Nick left a deliberate bug to blame all neg reps on MF? All mine are from him (apart from the one from d000000gh which has dropped off the bottom) so I wonder who they're really from...

mudskipper
8th February 2012, 20:05
I've had 19 negative since the 21st Jan which is as far back as I can go.

How many of them are from you?

AtW
8th February 2012, 20:06
I've had 19 negative since the 21st Jan which is as far back as I can go.

20...

Pogle
8th February 2012, 20:08
You don't get much rep do you. I haven't repped you in six months.

I've had 19 negative since the 21st Jan which is as far back as I can go.

Yeah, but all the rep in the world wont make up for your tiny penis :D

MarillionFan
8th February 2012, 20:11
Yeah, but all the rep in the world wont make up for your tiny penis :D

Or yours. :smokin

adubya
13th March 2012, 20:15
If anyone's interested then I've packaged this up as a Chrome extension.

Install http://knownentity.com/extensions/CUK-Forum-Extension.crx in Chrome, access the extension options and enable display of rep user.

Then whenever you visit the settings page http://forums.contractoruk.com/usercp.php the username of the person who supplied the rep is displayed.

Only tested on myself and I ain't got much rep but hopefully it will be OK :smile

Apologies to Nick for using his regular expression for obtaining the username and for the idea in the first place :happy

I might add some more features if I get the inclination / inspiration, all suggestions welcome!

adubya
13th March 2012, 20:33
Thanks MF and AtW for the rep ;)

AtW
13th March 2012, 20:40
Thanks MF and AtW for the rep ;)

You are welcome.

NickFitz
14th March 2012, 01:11
Apologies to Nick for using his regular expression for obtaining the username and for the idea in the first place :happy


No apology necessary - open source, public domain, etc. Still not sure if there's a bug in there, or if it's based on a false premise, or anything else that might explain the anomalous results some have reported, though :ohwell

Arturo Bassick
14th March 2012, 06:36
OH I didn't know you could do this - so I've just had a go.

Thanks Nick :wave:

I have 5 negative reps, 4 of which are from MF.

:facepalm:MF is rather lacking in the intelligence stakes and doesnt feel able to make a point or win an rgument in the main threads so he has to resort to a method where there is no come back for you. His neg remains whether he is right or wrong or even has a hint of a clue of what he is talking about.
Let him have his play thing, he needs it.

petergriffin
14th March 2012, 10:07
If anyone's interested then I've packaged this up as a Chrome extension.
Just for play's sake would you consider packaging a Firefox add-on? I have tried to convert your Chrome extension in a FF add-on and it installed all right but did nothing.

Troll
14th March 2012, 10:27
Just for play's sake would you consider packaging a Firefox add-on? I have tried to convert your Chrome extension in a FF add-on and it installed all right but did nothing.Works OK for me with FF (but I had to save it as a bookmark)

MarillionFan
14th March 2012, 10:29
MF is rather lacking in the intelligence stakes and doesnt feel able to make a point or win an rgument in the main threads so he has to resort to a method where there is no come back for you. His neg remains whether he is right or wrong or even has a hint of a clue of what he is talking about.
Let him have his play thing, he needs it.


Nope. I'm just pressed for time & think you're a gobshite.

hth

MF

adubya
14th March 2012, 10:40
The extension performance is a little slow but I have thoughts on how it can be improved, will do some further work this evening.

I'll have a look at the Firefox addon requirements also.

oracleslave
14th March 2012, 10:50
Nope. I'm just pressed for time

Try the logout link at the top of the page.

There's a whole world out there. :grin

MarillionFan
14th March 2012, 10:53
Try the logout link at the top of the page.

There's a whole world out there. :grin

It's big and scary out there! :emb

In here, I'm a tiger!!!!! Raaaaaaaaaaaaaaahhhhhhhhhh!

Peoplesoft bloke
14th March 2012, 12:59
This is hilarious - I don't normally look at rep but I notice Incognnasty gave me a neg and called me a faggot ages ago

petergriffin
14th March 2012, 13:09
Works OK for me with FF (but I had to save it as a bookmark)
Do you mean you've installed a Chrome extension directly on FF or have you hacked it first?

adubya
14th March 2012, 13:21
I guess he was referring to the original Javascript rep bookmarklet, not the Chrome extension.

petergriffin
14th March 2012, 13:55
I guess he was referring to the original Javascript rep bookmarklet, not the Chrome extension.
Gotcha, I had to drag the url into the Bookmarks toolbar. Thanks!

adubya
14th March 2012, 18:31
Updated the Chrome extension to version 1.1 now, speeds up the execution of the rep display.

Same download link http://knownentity.com/extensions/CUK-Forum-Extension.crx

xoggoth
14th March 2012, 19:32
Why bother seeing your reps? What you all need is a script to keep give ourselves a positive rep every minute.

Freamon
14th March 2012, 22:57
Why bother seeing your reps? What you all need is a script to keep give ourselves a positive rep every minute.

MF sent me a copy of his but I don't have QuickBasic installed.

NickFitz
15th March 2012, 00:56
MF sent me a copy of his but I don't have QuickBasic installed.

:spel BASICA.COM (http://en.wikipedia.org/wiki/IBM_BASIC#IBM_BASICA)

Freamon
15th March 2012, 06:38
:spel BASICA.COM (http://en.wikipedia.org/wiki/IBM_BASIC#IBM_BASICA)

We always used to find it amusing that the A in BASICA stood for "advanced"...

EternalOptimist
15th March 2012, 06:59
We always used to find it amusing that the A in BASICA stood for "advanced"...

which one ?

adubya
15th March 2012, 08:03
Updated the Chrome extension to version 1.1 now, speeds up the execution of the rep display.

Same download link http://knownentity.com/extensions/CUK-Forum-Extension.crx

Ooops, screwed up the upload. The link is still the slow version 1.0, will rectify tonight.

Sorry rep fans.

adubya
15th March 2012, 17:53
OK, faster version 1.1 deffo on this link now http://knownentity.com/extensions/CUK-Forum-Extension.crx

SimonMac
15th March 2012, 17:58
OK, faster version 1.1 deffo on this link now http://knownentity.com/extensions/CUK-Forum-Extension.crx

Doesn't work, are you sure you are cut out for programming?

AtW
15th March 2012, 18:00
You sad people, why do you want to know who gives you lots of +rep?

Be grateful for what you get! :smokin

adubya
15th March 2012, 18:01
:laugh

Have you enabled the rep display in the extension options ?

SimonMac
15th March 2012, 18:02
:laugh

Have you enabled the rep display in the extension options ?

Of course I have Now!

cojak
30th March 2012, 10:26
Moved to Welcome/FAQs

BrilloPad
30th March 2012, 11:08
Moved to Welcome/FAQs

:yay:

Is there any chance of telling us how a user's power is calculated? I will buy you a beer at the next meet up - and bring you one of Mrs BP's chocolate brownies.....

MarillionFan
30th March 2012, 12:38
Moved to Welcome/FAQs

Are you having a laff? Is she having a laff?

This thread should be deleted!:mad

AtW
30th March 2012, 13:05
Are you having a laff? Is she having a laff?

This thread should be deleted!:mad

WHS

BrilloPad
30th March 2012, 13:14
Are you having a laff? Is she having a laff?

This thread should be deleted!:mad

Why? :confused:

cojak
30th March 2012, 13:17
Well it won't be.

Cats and bags an' all that... ;)

pmeswani
30th March 2012, 13:52
Why? :confused:

MF likes to dish out his -ve Reps without being identified. :smokin

MarillionFan
30th March 2012, 15:30
Well it won't be.

Cats and bags an' all that... ;)

I'll tell Andy's mum!