DiggBar Killer

By Shaun Grady Last update Apr 11, 2009 — Installed 5,167 times. Daily Installs: 0, 3, 0, 0, 0, 1, 77, 98, 64, 21, 88, 17, 12, 21, 23, 6, 6, 13, 17, 3, 2, 12, 12, 7, 4, 4, 3, 1, 4, 4, 2, 0

Wouldn't it be easier if...

Subscribe to Wouldn't it be easier if... 2 posts, 2 voices

AmandaKerik Scriptwright

Wouldn't it be easier if you just:
parsed the text in the link's title attribute,
checked for the http part (as a failsafe against other described links),
then just switched out the address for the title's text

... which is the REAL address (no digg.com/blahfoo nonsense)?

I was hoping that was what this script did :).

 
Shaun Grady Script's Author

I thought about doing that, but it's too failure prone. When you view the comments page, the Digg anchor doesn't make use of the title attribute. Also, there is the possibility of Digg anchors residing within comments themselves that may need to be parsed and deciphered. Finally, Digg may arbitrarily decide to change the contents of the title attribute.

To handle these edge cases, the script would need to grow in complexity. I prefer to utilize a simple AJAX call to the Digg API to deal with the HREF anchor attribute directly.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel