Fixing UJM

UJM is the Governments preferred and recommended job search site for people claiming JSA. The trouble is it sucks and is also pretty slow.

I’ve been trying to fix some of the worst parts, using tampermonkey extension for Safari.

To try out these scripts install tamper monkey, click on the ‘add script’ in the tampermonkey toolbar menu  and  then copy/paste over the entire script using scripts from below.

I’ve created a GitHub repo and I’ll upload each file in its own branch.

Useless Home Page

When you login you are taken to a homepage that is pretty useless. Normally what I want to do is to add some activity logs to record my job search which I do mainly on indeed. What’s the solution ?  Redirect to the activity log but provide a button to cancel.

Additionally the only really useful thing on the home page is ‘my saved searches’ which are diligently  placed right at the bottom. They should be at the top, so see first script below !

Login timeout

If any one from DWP ever applied for a job before they joined the public purses gravy chain they would know that it can some times take more than 10 minutes to complete an application. Hence the login timeout on UJM is to say the least unfriendly. (the usernames are  10 digit numbers, I kid you not) Solution ? A script to automatically login ( assumes that safari has saved the login and password). See second script.

Jobs link

Oh look a nice link to show me some jobs, oh hang on it’s showing me 1.2Million jobs through out the UK, how come since I went through the trouble of adding my details ie. postcode, skills ? Solution… script to add postcode to search form and reload the page. Third script!

Tedium

I have not actually spoken to a jobcenter adviser who can be bothered to login to my UJM account to view my activity log for a while now. They used to love grabbing the paper forms, but hey, logging in requires finding my email address that is scrawled on my paper docs. some place and then it hardly ever works any way.

Sooner or later though I know I will meet some jobs-worth or newby adviser, or some one flown in from another office.

Also you need to show that you are doing what you have agreed to do and that you are logging in every day. Solution; fourth script to add a couple of buttons to add required logs to show that you have logged in and done your job searching. Button one simply records that you searched on UJM and the other one finds a suitable job search related activity for you. I also added a select control, that lets you use your list to remind you what activities you need to do. You should add to the script to add activities from your own job search routine.

I’ve also added some new styling and a visual warning that lets you know if you are trying to update a note when your session is likely to have expired, or you have too many characters. I’ve been caught out by this a number of times, you type in a note only to be redirected to a link to register. You loose your note and you don’t even get re-directed to the correct ( login) page !

Take home message

These scripts can round off a the worst sharp edges of UJM and  I hope they help some one. Happy job searching ☺

  1. Auto login if you click on a bookmark and you have saved un/pw
  2. redirect to activity log on login unless click ‘stay here’
  3. post button adds a ‘i was ere’ activity log or the contents of the textarea if it has been changed either manually or via script
  4. rnd button selects a random job search activity from the logs array and updates the texarea, you can keep clicking
  5. when you click the select element the selected item is then applied to the textarea
  6. The jobs link sets your post code as starters, you will need to change this of course, unless you live next door to me 🙂

1) Re-direct from Useless home page or move saved searches to top

// ==UserScript==
// @name UJM home redirect
// @namespace http://tampermonkey.net/
// @version 0.1
// @description redirect from useless UJM home page to activity log
// @author You
// @match https://jobsearch.direct.gov.uk/Home.aspx
// @grant GM_addStyle
// ==/UserScript==

(function() {
 'use strict';

 // Your code here...
 //https://jobsearch.direct.gov.uk/Account/ActivityHistory.aspx
 
 
 var zNode = document.createElement ('div');
zNode.innerHTML = '<button id="myButton" type="button">' + 'Stay Here</button>';
zNode.setAttribute ('id', 'myContainer');
document.body.appendChild (zNode);

//--- Activate the newly added button.
document.getElementById ("myButton").addEventListener (
 "click", ButtonClickAction, false
);

 var tOut = setTimeout( stop, 3000);

 
function ButtonClickAction (zEvent) {
 /*--- For our dummy action, we'll just add a line of text to the top
 of the screen.
 */
clearTimeout(tOut);
 zNode.style.display="none";
 // move saved searches to top
 document.querySelector(".content_section").insertBefore(document.querySelector(".content_section:last-child"));

}

//--- Style our newly added elements using CSS.
GM_addStyle ( multilineStr ( function () {/*!
 #myContainer {
 position: absolute;
 top: 0;
 left: 300px;
 font-size: 20px;
 background: orange;
 border: 3px outset black;
 margin: 5px;
 opacity: 0.9;
 z-index: 222;
 padding: 5px 20px;
 }
 #myButton {
 cursor: pointer;
 }
 #myContainer p {
 color: red;
 background: white;
 }
*/} ) );

function multilineStr (dummyFunc) {
 var str = dummyFunc.toString ();
 str = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*!
 .replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ }
 .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them.
 ;
 return str;
}
 function stop () {
 window.location.assign("https://jobsearch.direct.gov.uk/Account/ActivityHistory.aspx");}
})();

2) One Click login, via favourites bar

// ==UserScript==
// @name UJM auto login from bookmarked login URL
// @namespace hwhap.com
// @version 0.1
// @description one click UJM login
// @author You
// @match https://authenticate.gateway.gov.uk/sidp/SignIn.ashx?gwv=1.0&gwrealm=urn%3aTransformingLabourMarketServices&gwtheme=directgov&gwcategory=Ind
// @grant none
// ==/UserScript==

(function() {
 'use strict';

 // Your code here...
 console.log("simon");
 var login=document.getElementsByName("ctl00$fixedContent$Username$loginButton")[0];
 setTimeout(function(){ console.log("logging in");login.onclick.apply(login);}, 1000);
})();

3) Fix the Retarded Jobs link

// ==UserScript==
// @name UJM set jobs search area
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://jobsearch.direct.gov.uk/Jobsearch/PowerSearch.aspx
// @grant none
// ==/UserScript==

(function() {
 'use strict';

 var searchArea=document.getElementsByName("MasterPage1:HeaderContent:Header_Default:searchControlsSwitcher:_ctl0:_tbWhere")[0];
 console.log(searchArea.value);
 if (searchArea.value=="Postcode or location") 
 {
 searchArea.value= "bh255un";
 document.getElementById("MasterPage1_HeaderContent_Header_Default_searchControlsSwitcher__ctl0_btnSearch").click(); }

})();

4) Auto Beef up buttons for Activity Log, now allows you to select from a list

// ==UserScript==
// @name ujm buttons to add a log
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://jobsearch.direct.gov.uk/Account/ActivityHistory.aspx
// @grant GM_addStyle
// ==/UserScript==

(function() {
 'use strict';



var zNode = document.createElement ('div');
zNode.innerHTML = '<button id="myButton" type="button">'
 + 'post</button>'
 + '<button id="randomLog" type="button">'
 + 'Rnd</button>'
 ;
zNode.setAttribute ('id', 'myContainer');
document.body.appendChild (zNode);

//--- Activate the newly added button.
document.getElementById ("myButton").addEventListener (
 "click", ButtonClickAction, false);
 document.getElementById ("randomLog").addEventListener (
 "click", addRandomLog, false);

 var logs = ['Looked on Tesco and LIDL web sites',
 'Went around local shops looking for signs',
 'edit script to add as many as  you like'
 
 
 ];
 addInput(zNode);


 function addInput(divName) {
 var newDiv = document.createElement('div');
 var selectHTML = "";
 selectHTML='<select id="noteSelect" >';
 for(var i = 0; i < logs.length; i = i + 1) {
 selectHTML += "<option value='" + logs[i] + "'>" + logs[i] + "</option>";
 }
 selectHTML += "</select>";
 newDiv.innerHTML = selectHTML;
 //document.getElementById(divName).appendChild(newDiv);
 divName.appendChild(newDiv);
document.getElementById("noteSelect").addEventListener("change", function(){ document.getElementsByName("MasterPage1:RightColumnContent:InsertJobSearchNote:NoteTextArea")[0].value=document.getElementById("noteSelect").value; });

}
 
 
 function addRandomLog () {


//alert(logs[3]);
 //alert (logs[Math.floor(Math.random()*logs.length)]);
 document.getElementsByName("MasterPage1:RightColumnContent:InsertJobSearchNote:NoteTextArea")[0].value=logs[Math.floor(Math.random()*logs.length)];
 //doUjLog ();

}
function doUjLog () {
 WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("MasterPage1:RightColumnContent:InsertJobSearchNote:lnkbReference", "", true, "", "", false, true));

}
function ButtonClickAction (zEvent) {
 /*--- For our dummy action, we'll just add a line of text to the top
 of the screen.
 */
 /* var zNode = document.createElement ('p');
 zNode.innerHTML = 'The button was clicked.';
 document.getElementById ("myContainer").appendChild (zNode);*/
 if (document.getElementsByName("MasterPage1:RightColumnContent:InsertJobSearchNote:NoteTextArea")[0].value=="For example, enter details about following up on a job referral or calling about a job advertised in the newspaper.")
 {//add a default message
 var dailyLog=['logged onto UJM and searched jobs',
 'searched UJM and indeed',
 'performed search on UJM',
 'log onto UJM and indeed',
 'checked Universal Job Match for new jobs',
 'went onto UJM online and checked jobs',
 'went through new jobs on indeed and jobmatch', 'logged on to UJM to search jobs', ];
 
 document.getElementsByName("MasterPage1:RightColumnContent:InsertJobSearchNote:NoteTextArea")[0].value=dailyLog[Math.floor(Math.random()*dailyLog.length)];
 }
 //WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("MasterPage1:RightColumnContent:InsertJobSearchNote:lnkbReference", "", true, "", "", false, true));
 doUjLog ();
}
 
 GM_addStyle ( multilineStr ( function () {/*!
 #myContainer {
 position: absolute;
 top: 170px;
 left: 300px;
 font-size: 20px;
 background: orange;
 border: 3px outset black;
 margin: 5px;
 opacity: 0.9;
 z-index: 222;
 padding: 5px 20px;
 }
 #myButton {
 cursor: pointer;
 }
 #myContainer p {
 color: red;
 background: white;
 }
*/} ) );

function multilineStr (dummyFunc) {
 var str = dummyFunc.toString ();
 str = str.replace (/^[^\/]+\/\*!?/, '') // Strip function () { /*!
 .replace (/\s*\*\/\s*\}\s*$/, '') // Strip */ }
 .replace (/\/\/.+$/gm, '') // Double-slash comments wreck CSS. Strip them.
 ;
 return str;
}
 function update () {
 document.getElementsByName("MasterPage1:RightColumnContent:InsertJobSearchNote:NoteTextArea")[0].value=document.getElementById("noteSelect").value;
 } 
})();
facebooktwitterlinkedinrssfacebooktwitterlinkedinrss

Leave a Reply

Your email address will not be published. Required fields are marked *