March 13, 2006

Link Referencing Bookmarklet

Today's half hour bookmarklet hack is inspired (again) by Library Clips, this time with respect to a request for A list of hyperlink URL's for a printed webpage:

Do you ever have a problem when reading a printed page from a blog or a website that you come across a word that has an underline under it as it is a hyperlink, and you wonder where does this link to…not only can you not launch to this hyperlink, but you don’t even know it’s URL…so the printed page is very limited in this aspect.

... I would like to hit a bookmarklet to generate a list of hyperlinks on a given webpage, and then secondly be able to print this as a numbered list of hyperlinks placed at the end of the print out, and each number would match up to an annotated number on each hyperlink in the body of the page.

OK - here's a quick attempt: LinkRefs bookmarklet.

The bookmarklet (only tested (?err, not quite, tried out on a couple of pages where it sort of works)) as ever on Firefox will add a reference number to every anchor tag (<a> with an href attribute starting http://, and then print a numbered reference list of URLs at the end of the page.

There are some severe styling issues, as trying out the bookmarklet on John's post shows, but at other times the effect can be almost useful (e.g. try the bookmarklet out on this page).

My laptop isn't connected to a printer, so I don't know what happens if you print the page (i.e. whether the dynamically added annotations are sent to the printer, or just the original page. (Please let me know if you try it out whether it works for printing or not).

For this to be useable, I think you'd need to find a way of working out - and specifying easily - which links you want automatically referencing, and how to display them in a page rich with CSS layout features.

I guess it could work in a templated environment, e.g. where you know the page structure and can perhaps just pull out links in a content area wrapped by a div tag with a particular id.

One thing this bookmarklet suggests to me is that being able to rapidly prototype bookmarklets/mini applications can help in refining user requiements.

So for example, how might the orginal, informal bookmarklet spec be refined given the problems turned up by the rapid prototype? ;-)

Posted by ajh59 at March 13, 2006 10:43 AM
Comments

Wow, you are fast...

Posted by: John Tropea at March 14, 2006 01:07 AM