Tillamook Cheddar
Pro tip: delicious Tillamook Cheddar now available at Rochester area Wegmans stores, and at a great price too ($7.99/lb)
Pro tip: delicious Tillamook Cheddar now available at Rochester area Wegmans stores, and at a great price too ($7.99/lb)
The other day I noticed that Amazon owns the "amzn.com" domain and they use it to generate short links to products. Unfortunately, the only way I've found to directly create the short links is to use a very tiny 'share on Twitter' button on the product page:
This button opens a new browser window and pre-fills the status update field with the short link. But what if you want to paste a short link into an email or Twitter client? Let's solve that problem by creating a JavaScript bookmarklet that returns a shortened URL, and optionally appends your Amazon affiliate code.
I've explored this area before by using Mac OS X's Automator and Ruby. This time, let's create a cross-platform solution.
Stoyan Stefanov created a bookmarklet solution that grabs the ASIN from most Amazon product pages and returns a URL without all the cruft. I like the simplicity of Stoyan's solution, as it uses JavaScript to grab the ASIN by its element ID, instead of using a complicated regex. We'll use his code as a starting point, and tweak it to support the new short domain.
The short link format is simple, it's just "http://amzn.com/" + the ASIN.
If you want to generate URLs with an affiliate ID, use this code:
otherwise use this:
Edit your Affiliate ID (if applicable), then paste the code into the very handy Bookmarklet Crunchinator. Drag the output link to your bookmarks bar, and you're done!
Now, when you visit an Amazon product page, you can click your bookmarklet and a shortened URL is returned. This seems to work on most products, though I've run into a few (like Kindle books) that don't seem to work.
Enjoy!
Comments [0]
Comments [0]
How to make engineers write concisely with sentences? By combining journalism with the technical report format. In a newspaper article, the paragraphs are ordered by importance, so that the reader can stop reading the article at whatever point they lose interest, knowing that the part they have read was more important than the part left unread.
State your message in one sentence. That is your title. Write one paragraph justifying the message. That is your abstract. Circle each phrase in the abstract that needs clarification or more context. Write a paragraph or two for each such phrase. That is the body of your report. Identify each sentence in the body that needs clarification and write a paragraph or two in the appendix. Include your contact information for readers who require further detail.
— William A. Wood, September 8, 2005 (source)
Comments [0]
The amazing SLAM-BASA sandwich from DJ's European Deli & Market in Dorchester, MA.
Kielbasa, hot peppers, barbecue sauce, garlic ham and polish cheese on a sub roll. *droooooooooool*
Comments [0]
Comments [0]