Twitter Share Bookmarklets Secret Feature
I just discovered something really cool about Twitter’s Share Bookmarklet, though I’m quite sure somebody would’ve noticed this before.
Yesterday I was reading a piece on Steve Jobs, and I decided to share it on Twitter. Keep in mind that it was a paginated article (split into 2 pages). Only after sharing it did I realized I was on the 2nd page of the article when I shared it, and the URL of that page was was:
www.nytimes.com/2011/10/07/opinion/the-man-who-inspired-jobs.html?pagewanted=2
Notice the end of the URL clearly saying pagewanted=2. However, when I checked my tweet, the URL that Twitter included had turned into:
www.nytimes.com/2011/10/07/opinion/the-man-who-inspired-jobs.html?pagewanted=all
I couldn’t believe it. I tried the Share bookmarklet on the page again, and sure enough, it was changing 2 to all. I then decided to experiment a little bit more - and see if this feature on other websites as well.
Here’s a list of pairs of URIs - the first URI is the actual page that was shared, and the 2nd URI is the ‘converted’ version - by Twitter’s apparently smart bookmarklet.
First up: Wired and GQ - which have a URL strucuture similar to that of NYTimes - they use a query string to specify pagination:
www.wired.com/wiredscience/2011/10/living-relics/?pid=2212 www.wired.com/wiredscience/2011/10/living-relics
www.gq.com/news-politics/big-issues/201109/dont-ask-dont-tell-gay-soldiers-military?currentPage=2
www.gq.com/news-politics/big-issues/201109/dont-ask-dont-tell-gay-soldiers-military
Next, Vanity Fair uses a fragment identifier:
www.vanityfair.com/business/features/2011/11/michael-lewis-201111#gotopage2 www.vanityfair.com/business/features/2011/11/michael-lewis-201111
And finally, Playboy and The Atlantic - which actually pass the page number as the last parameter in their URL:
www.playboy.com/magazine/playboy-interview-steve-jobs/2 www.playboy.com/magazine/playboy-interview-steve-jobs
www.theatlantic.com/magazine/archive/2011/07/the-brain-on-trial/8520/3/ www.theatlantic.com/magazine/archive/2011/07/the-brain-on-trial/8520
This seems more and more like specific use-cases added by Twitter to make their bookmarklet ‘smarter’. I’m not sure which CMSs the above sites run on, and it could be quite well be CMS-specific.
However, it did fail to do the magic on some websites:
Esquire passes the page number as a hyphenated value at the end of the URL-slug of the article.
www.esquire.com/features/william-petit-case-0611-4
NY Books, meanwhile, has a query string style page number, but it didn’t work.
www.nybooks.com/articles/archives/2011/aug/18/very-deep-america-friday-night-lights/?page=2
Sports Illustrated was an interesting case. The page number is the second-last parameter in the URL, with the last parameter being index.htm. I expected the bookmarklet to fail to work on this, and it did. It even failed when I removed the index.htm at the end.
sportsillustrated.cnn.com/vault/article/web/COM1061362/3/index.htm sportsillustrated.cnn.com/vault/article/web/COM1061362/3
I wonder if some Javascript Ninja could help out here, the Twitter Share Bookmarklet points to a share.js, that seems to do the magic.
Any thoughts? Tweet me @hardikr !
