The first line of the code I had shown you before needs updated to the following:
path = document.getElementsByClassName("logo" )[0].childNodes[1].href;
I realized today due to Jagex's inconsistency, viewing a news post removes the ID from the URL. Using that line will allow (as far as I can currently tell) a foolproof method of grabbing it. PAGEGLOBALS houses a usable URL, but it's part of the FB plugin and thus loads late.
05-Apr-2014 05:46:39