

Ask HN: How would you link to specific parts of a page? - Skywing

Hi all,<p>The other day, a friend and I were eating lunch and I was dropping my usual, subliminal "so, any cool neat ideas for websites?" type questions. He always seems to have complaints about the web, which are good for somebody like me (always looking for fun projects). After some discussion we started coming up with a pretty neat sounding idea.<p>The idea is to be able to highlight some text on a page, and create a permalink to the page that shows those highlights. For example, you're on Wikipedia and see a sweet quote, or really important word, and you want your buddy to read it. You could copy and paste it to him, over AIM or something, and then send him the URL, too. Or you could just send him the URL and say "scroll down to the third paragraph." Or, you could use this idea and highlight that quote or word somehow and create a permalink to that exact word. It would function exactly like HTML anchors do, but without requiring that page to have an anchor where you want to link to.<p>I don't know if anything likes this exists in a pure Javascript form or not. I know there are browser plugins that can kind of do this. I know some blogs append anchors to every paragraph for this. But, that doesn't really matter, I'm just trying to figure out how this would be possible without using those methods.<p>I was thinking in terms of Javascript, but I'm not sure if it's quite possible. I'm pretty sure you can't load up the page being linked to in an iframe and run javascript on it. I know you can't ask that page to load your JS.<p>Does anyone have any ideas on how this could be possible without a browser plugin?<p>Edit: I have also thought about a bookmarklet. This would allow you to generate a link to a certain area of a page, using whatever algorithms you had to find that area and create a link. But, I don't know how it would work in the opposite direction: going from link -&#62; area of page.
======
bigiain
You could proxy the page, and rewrite bits of it on the fly (adding a class
and/or anchors around the bit you wanted to highlight).

If I wanted to do this, I'd start by hacking for a few hours on
<http://www.jmarshall.com/tools/cgiproxy/> I'm pretty sure I could get a (non-
scalable, resource hungry) proof of concept running in a evening starting from
there - that'd be enough to start showing people and seeing if they even
understand why you might want to use something like this...

------
sorghum
I worked on just this for last year's Rails Rumble:

<http://morsurl.com/>

The site acts as a proxy, injecting some Javascript based on SelectorGadget to
allow the user to select parts of the page, and injecting inline styles to
display the highlighted parts of the page.

~~~
Skywing
Nice, man. Cool name for it, too.

------
uvince
Done. No extension necessary.

<http://awurl.com/wcD8whqQG>

~~~
briandoll
Clickable link to the actual service: <http://www.awesomehighlighter.com/>

------
smoody
also look at www.snip.ly -- it doesn't highlight per-se, but it brings the
text you've selected in a lightbox over the original article. Like
awesomehighlighter (which someone else mentioned, it won't work on NYTimes
pages.

also, check out Diigo. It's the bookmarking service i use. They let you
highlight text, add post-its, etc. as part of the bookmarking process.

------
cwtann
This concept sounds like a great idea for a chrome extension.

~~~
Skywing
Well, you could probably write an extension pretty easily, but that doesn't
quite make the links very portable.

