GitXplorerGitXplorer
p

tweet-shorturl

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
6279fb5d9a5d1ba9c629b7921efb7fd12b8f913a

Refactor. Only shorten links using bitly if over 24 characters.

pphiloye committed 14 years ago
Unverified
661d7b4037805717540ce08cfadf0d091e925eba

renamed js file

pphiloye committed 14 years ago
Unverified
7b2fed632defeebf5d70b22763059fc3fd9492ec

Updated readme

pphiloye committed 14 years ago
Unverified
90290cea612b59d4dda5e7ce929dbab587131dd7

First release

pphiloye committed 14 years ago

README

The README file for this repository.

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.