User:Wouldtherebeapie/monobook.js

/* function mkDate( dt ) { return ["January","February","March","April","May","June","July","August","September","October","November","December"][dt.getMonth] + "_" + dt.getDate + ",_" + dt.getFullYear; }

function dynamicFeature { if( wgPageName != "Main_Page" ) return; var featureDiv = document.getElementById( "mp-tfa" ); if( featureDiv ) window.clearInterval( dInterval ); else return; var paras = featureDiv.getElementsByTagName( "P" ); alert( paras.length ); for( var i in paras ) {  alert( i ); if( !paras[i] ) continue; if( !paras[i].innerHTML ) continue; if( !paras[i].innerHTML.match( /^Recently featured: / ) ) continue; var recentlyFeatured = paras[i]; break; } if( !recentlyFeatued ) return; var featureLinks = recentlyFeatured.getElementsByTagName( "A" ); featureDate = new Date.getTime; for( var i in featureLinks ) { featureDate -= 1000 * 60 * 60 * 24; featureLinks[i].href = "/wiki/Wikipedia:Today%27s_featured_article/" + mkDate( new Date( featureDate ) ); } }

var dInterval = window.setInterval( dynamicFeature, 500 );