Getting more from your SMH website

If the Sydney Morning Herald's clickbait headlines are annoying you, I offer you this.

It will change the tooltip (that's the little bit of text you get when you hold your mouse-pointer over a link) to show how the story is categorised and display a fuller headline if one is available.

SMH Headline info

Instructions

This is a simple little program called a bookmarklet. To get it working:
  1. Add the bookmarklet to your browser's menu bar. Generally you can simply drag the button above up to your menu bar and drop it where you want it.
  2. Open up the Sydney Morning Herald website.
  3. Click on the SMH Headline info bookmarklet on your menu bar.
  4. Hold your mouse over a headline.
It's important to note that not every, single headline contains fuller informartion. Sometimes the clickbait is all there is.

Explanation

I get really angry reading the Sydney Morning Herald's website these days. They reproduce stories from overseas without warning you that they are not local, and they tease in the headline forcing you to click through to find out if the story is even relevant - that's clickbait in action.

Now you might think 'that's just the way things are these days' but there are other news websites that don't do that: the BBC and the New York Times to name two.

One day I noticed that the link in the headlines on the Herald site contained the full headline and categories that you would see when you click on it. The information was there for everyone to see, it was just not easy to read. So I decided to take a stab at making it more accessible.

Warning and disclaimer

This bookmarklet is deliberately not intended to make any significant change to the SMH page. It simply takes information that is already there and makes it slightly more accessible. The process is entirely ephemeral and needs to be activated by the user each time the SMH page is loaded. It is analogous to you scribbling on your newspaper.

Just in case it's not obvious, you don't have any obligation to make use of this little tool. So if you do so, you do so entirely at your own risk and you comprehensively agree not to blame anyone over of this end of the web for anything.

The code

This bookmarklet is a little program that runs in the browser. It is written in JavaScript. Basically it reads the web address hidden in the link and makes it more readable by humans. Here is the code:

javascript:function RIT(lX2)
{void(g=lX2.getElementsByTagName('img'));
for(j=0;j<g.length;j++){
if(g[j].alt!=''||g[j].title!='')
void(g[j].alt+='\n\n'+lX2.title);}}
function LT(wndwZ04){
void(l=wndwZ04.document.links);
for(i=0;i<l.length;i++){
if(!l[i].titleMod){
void(trg=l[i].target);
if(trg!='')trg+=':\n';
void(tit=l[i].title);
if(tit!='')tit+='';
void(nsd=l[i].href.replace('http://www.smh.com.au',''));
void(nsd=nsd.replace('http://www.dailylife.com.au',''));
void(nsd=nsd.replace('http://www.goodfood.com.au',''));
void(nsd=nsd.replace('http://news.domain.com.au',''));
void(nsd=nsd.replace(/\//g,'\n'));
void(nsd=nsd.replace(/-/g,' '));
void(nsd=nsd.replace(/\d{8}/,' '));
void(nsd=nsd.replace(/.{6}\.html/,' '));
void(l[i].title=tit+trg+nsd);
void(l[i].titleMod=true);
RIT(l[i]);}}}LT(window);
for(iG4=0;iG4<
frames.length;iG4++)LT(frames[iG4]); 
 
This bookmarklet was based upon one found here.