I wrote a small Ruby script which allows me to post my currently-active Safari tab on Twitter, including the possibility of adding hashtags. Here's the code, though you you'll find any updates to the script over here, and a bit more detail can be found in this blog post.
This script uses the RubyOSA bridge for AppleScript support from within Ruby, as well as quite a few other gems (why reinvent the wheel?).
[robg adds: If (like me) you're not a Ruby user, it will take a bit of effort to get this script to work. First, save the above as a text file somewhere on your path and make it executable (chmod a+x tweetsafari.rb). In order to get it working on my machine, I had to uncomment the require 'rubygems' line, and edit the twitter_user = 'your_twitter_username'. I also had to install some of the listed gems from the script. You can do this with the sudo gem install gem_name command. On my machine, I had to install rubyosa, shorturl, and twitter4r in order to get the script to work. Once I had all those bits, though, it worked as described, and tweeted a shortened URL version of my active Safari tab.]
[robg adds: If (like me) you're not a Ruby user, it will take a bit of effort to get this script to work. First, save the above as a text file somewhere on your path and make it executable (chmod a+x tweetsafari.rb). In order to get it working on my machine, I had to uncomment the require 'rubygems' line, and edit the twitter_user = 'your_twitter_username'. I also had to install some of the listed gems from the script. You can do this with the sudo gem install gem_name command. On my machine, I had to install rubyosa, shorturl, and twitter4r in order to get the script to work. Once I had all those bits, though, it worked as described, and tweeted a shortened URL version of my active Safari tab.]
•
[7,537 views]

