Skip to content

philoye/tweet-shorturl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Tweet Shorturl

This is a bookmarklet that finds a canonical short url from the current webpage (or creates a new bit.ly url if none exists) and then sends that to Twitter as the basis of a new tweet.

How it works

The bookmarklet first tries to find any one of the following: rev='canonical', rel='shortlink', rel='shorturl', rel='alternate short', or rel='alternate shorter'. If the page doesn't have one of the above, it then uses the bit.ly api to create a short url for you.

Credit where credit is due

The idea for this came from Lachlan Hardy's Tweet-Canonical.

The bulk of the code came from Joel Watts's gist. I simply swapped the prompt for the Twitter redirect.

Installation

To install the bookmarklet, first you'll need to add your BITLY_USERNAME and BITLY_API_KEY. You can get the latter from your bit.ly Account

Then you'll need to paste the JS into a bookmarklet builder such as this.

Copyright

Copyright (c) 2010 Phil Oye under the MIT License. See LICENSE for details.

About

A bookmarklet that helps tweet a canonical shorturl or a new bitly url.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published