Post · 1 min read· p. 374

Greasemonkey scripts to fix the Apply Yourself user interface

[add-dl-link.user.js]

text
// ==UserScript==
// @name           AY: Add download link
// @namespace      http://matt.might.net/ 
// @description    Adds a [Download] link to the full app (in pdf) for student search results
// @include        http*://webcenter.applyyourself.com/AYSearchForStudent/search_for_student_record_results.asp*
// ==/UserScript==


var apps = document.getElementsByTagName("A") ; 

try {
 
  for (i = 0; i < apps.length; ++i) {
   var m ;

   if (!apps[i].href) {
     continue ;
   }

   if (m = apps[i].href.match(/javascript:print\((\d+)\)/)) {
     var par = apps[i].parentNode ;
     par.innerHTML = par.innerHTML + ' [<a href="https://webcenter.applyyourself.com/AYApplicantMain/Application_'+m[1]+'.pdf?ct=PDF&d=1327260446976">'+m[1]+'.pdf</a>]' ;
   }
  }
} catch (e) {
  console.log("failure: " + e) ;
}