Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Tweet Tweet...

As the title suggests, let's see you javascript-guru's break out the grease and integrate twitter. This is absolutely necessary because the community has a sharp division over what SO is, and is not. Some say twitter should be avoided because SO isn't a social-networking site, and yet many of us find twitter to be a part of our normal every-day life.

Start your engines. And integrate "Tweet This"!

Hello World:

share|improve this question
Is this truly required in light of the completed request ? – Scott Wilson Apr 7 '12 at 20:48
up vote 11 down vote accepted

Preview of SOtweet

..and it works

// ==UserScript==
// @name           SOtweet
// @namespace      org.neverfear.sotweet
// @include*
// @include*
// @include*
// ==/UserScript==

// Set CSS style
var style = window.document.createElement('style');
style.type = 'text/css';
style.innerHTML = '#tweeeet{display:none;position:absolute;left:30%;top:40%;width:350px;height:100px;padding:10px;background:#9AE4E8;-moz-border-radius:10px}#tweetmsg{display:none;} #tweetsubmit{display:none}';

  function GM_wait() {
    if(typeof unsafeWindow.jQuery == 'undefined') { 
    } else { 
      $ = unsafeWindow.jQuery; letsJQuery(); 

  function letsJQuery() {
    function getTinyURL(longURL, success) {
        var API = '';
        var URL = API + encodeURIComponent(longURL) + '&callback=?';

        $.getJSON(URL, function(data){
            success && success(data.tinyurl);

    // The tweet'ify div, shown by the tweet link
    $('body').prepend('<div id="tweeeet"><form id="tweetform"><div id="tweetloading"><img src="" width="24" height="24"><span id="loadingmsg"></span></div><p><img src="" width="27" height="26"><textarea rows="3" cols="40" id="tweetmsg"></textarea></p><p><input type="button" value="Close!" id="tweetclose">&nbsp;<input type="submit" value="Twitter\'ify it!" id="tweetsubmit"></p></form></div>');

    $('.post-menu').append('<span class="link-separator">|</span><a href="#" id="tweetifylink">tweet</a>');

    $('#tweetifylink').bind('click', function(){

      // Show loading thingy, hide form until tinyurl is grabbed
      $('#loadingmsg').append('Getting TinyURLified address');

      $('#tweetclose').bind('click', function(){

      getTinyURL(document.location, function(tinyurl){
        // TinyURLification complete, enter into tweetmsg input, submit
        $('#tweetmsg').val(tinyurl + ' "' + document.title +'"');

          var submiturl = '' + encodeURIComponent($('#tweetmsg').val());
          window.location.href = submiturl;



  • Make tweet buttons on each answer submit the link to the answer's permalink, not the question
  • Tidy up CSS styles from a single-line string
  • Tidy up HTMl additions from a single string
  • Truncate title if too long
  • Use #stackoverflow/#serverfault/#metaso hashtag, and remove - Stack Overflow/etc from message?
  • Move imageshack-hosted Twitter logo into data: URI?
  • Only add styles on-click, rather than at the scripts top level?
  • Dim page background when popup is added
  • Look for JSONP service, instead of tinyurl (shorter URL)?
  • Add support for SuperUser
share|improve this answer
is there an install script for this? if not how do you manually install a greasemonkey script – Omar Kooheji Jul 13 '09 at 15:58
Firefox > Tools > Greasemonkey > New User Script – Sampson Jul 13 '09 at 16:00
I can see this build out the twitter URL, but nothing seems to happen after that... – RSolberg Jul 13 '09 at 17:14
I hope this script puts the integrate a "Twitter Link" requests to bed. – ahsteele Jul 13 '09 at 17:24
@ahsteel: that request is just getting started... GreaseMonkey scripts don't work on all platforms... – RSolberg Jul 14 '09 at 7:07
@RSolberg which platforms? You mean outside the Firefox ecosystem? Assuming you mean only those that aren't using Firefox if it is that important to them they can use Firefox and Greasemokey for SO. – ahsteele Jul 15 '09 at 17:15
dbr: You forgot Superuser! Also, how about instead of Sure the URLs will be a bit longer, but I like their support for metrics. – Chris Charabaruk Jul 19 '09 at 16:00
Another thing: It doesn't seem to work for tweeting answers, just questions. – Chris Charabaruk Jul 19 '09 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .