Created
May 3, 2010 03:33
-
-
Save dce/387715 to your computer and use it in GitHub Desktop.
Simple Chrome extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<script src="jquery-1.4.2.min.js"></script> | |
<script> | |
var bitly = { | |
login: "your_login", | |
api_key: "your_api_key" | |
}; | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
$.get("http://api.bit.ly/v3/shorten?login=" + bitly.login + | |
"&apiKey=" + bitly.api_key + "&longUrl=" + tab.url, function(response) { | |
chrome.tabs.create({ url: "http://twitter.com/home?status=" + response.data.url}); | |
}); | |
}); | |
</script> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Tweet this page", | |
"version": "1.0", | |
"description": "Shorten the current URL and put it a tweet.", | |
"browser_action": { | |
"default_icon": "icon.png" | |
}, | |
"background_page": "background.html", | |
"permissions": [ | |
"http://api.bit.ly/", | |
"tabs" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment