How does HuffPo append URLs to copied text?
September 25, 2009 10:05 AM   Subscribe

I noticed today that text copied from articles on The Huffington Post appends the article URL when pasted and I'm wondering how it's done.

Here's an example of copying and pasting text from the current front page story of the G20 meeting:

The three leaders, in their dramatic joint statement that overshadowed the G-20 economic summit here, hoped the disclosure would increase pressure on the global community to impose new sanctions on Iran if it refuses to stop its nuclear program.

Read more at:

The "Read more at:..." portion never appeared on the page.

Repro steps:

1) Copy any random paragraph from a HuffPo story.
2) Paste elsewhere.

I'm using FireFox 3.5.3 on Windows 7. I don't see this behavior when copying from other sites.
posted by eyeballkid to Computers & Internet (10 answers total) 6 users marked this as a favorite
Best answer: javascript
posted by sanko at 10:10 AM on September 25, 2009 [1 favorite]

Best answer: They include a link to a script file:
<script type="text/javascript" src="/include/lib/copy_paste.js?v=1.02"></script>
Which captures your "copy", and adds that text.
posted by blue_beetle at 10:11 AM on September 25, 2009 [1 favorite]

Check out Tynt Tracer for more information.
posted by Johnny Assay at 10:15 AM on September 25, 2009 [1 favorite]

Just a reference point for you: In OS X, dragging the text to the desktop (in OS X this is a textclipping file) doesn't reproduce the javascript tag, but copying to "compose email" in gmail does.
posted by sharkfu at 10:15 AM on September 25, 2009 [1 favorite]

Response by poster: Thanks. I just found the script after missing it the first time through the source. I didn't realize that javascript could be used to modify your copy.
posted by eyeballkid at 10:15 AM on September 25, 2009

That's messed up. For what it's worth, the Copy As Plain Text add on for Firefox clears that out, as you would expect.
posted by CunningLinguist at 10:52 AM on September 25, 2009 [1 favorite]

Response by poster: It is messed up, I was surprised by it when I IM'ed a paragraph from a different story this morning and had to edit it out. Thanks for the Copy as Plain Text suggestion.
posted by eyeballkid at 11:11 AM on September 25, 2009

Whatever they're trying to do with that script, it does not work with firefox 2.0 on linux, as I don't see anything appended when I paste.
posted by Rhomboid at 3:41 PM on September 25, 2009

Nor does it work in Safari on Snow Leopard.
posted by impluvium at 7:56 PM on September 25, 2009

Things like this are why I love-love-love PureText!
posted by sprocket87 at 1:59 PM on September 29, 2009

« Older Weird period   |   Going native with Seattle plants: R U doing it... Newer »
This thread is closed to new comments.