Originally posted by NickFitz
View Post
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
A Rep-Identifying Bookmarklet
Collapse
X
Collapse
-
-
Originally posted by OwlHoot View PostI've had that, for some post of either scintillating wit or exceptional stupidity/offensiveness.
Each rep has it's own entry, with a unique post ID and user ID.Comment
-
Originally posted by Gonzo View PostI had just never posted anything that more than one person thought worthwhile repping before.“The period of the disintegration of the European Union has begun. And the first vessel to have departed is Britain”Comment
-
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?
Originally posted by NickFitz View Post- 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.)
Code: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);}})()
Code: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;
- 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
I'll post a neatly-formatted version of the code below for those who want to check out how it works - it's pretty trivialOriginally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
- Copy the following (very long) line of code (a triple-click anywhere in the code box ought to select it all):
-
Originally posted by d000hg View PostI 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?Comment
-
Originally posted by d000hg View PostI 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?Comment
-
Originally posted by k2p2 View PostDid it find this thread?Originally posted by MaryPoppinsI'd still not breastfeed a naziOriginally posted by vetranUrine is quite nourishingComment
-
-
Originally posted by TimberWolf View PostI tried it in all my browsers and no joy.
Edit just tried it again in IE and it worked fine!Coffee's for closersComment
-
Originally posted by Spacecadet View PostI'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!
Code:// ==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);}})()
merely at clientco for the entertainmentComment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Five tax return mistakes contractors will make any day now… Today 09:27
- Experts you can trust to deliver UK and global solutions tailored to your needs! Yesterday 15:10
- Business & Personal Protection for Contractors Yesterday 13:58
- ‘Four interest rate cuts in 2025’ not echoed by contractor advisers Yesterday 08:24
- ‘Why Should We Hire You?’ How to answer as an IT contractor Jan 7 09:30
- Even IT contractors connect with 'New Year, New Job.' But… Jan 6 09:28
- Which IT contractor skills will be top five in 2025? Jan 2 09:08
- Secondary NI threshold sinking to £5,000: a limited company director’s explainer Dec 24 09:51
- Reeves sets Spring Statement 2025 for March 26th Dec 23 09:18
- Spot the hidden contractor Dec 20 10:43
Comment