Hey there, I'm Wynn!
I'm a front-end designer & developer, CSS & JavaScript framework fanboy Razorback living in Texas.
Featured
-
Recently
Archives
Links
The Changelog – Open Source moves fast. Keep up.- NoRM - Bringing MongoDB to .NET, LINQ, and Mono
- Episode 0.1.6 - Ajax.org frameworks with Ruben Daniels and Rik Arends
- Git clone some nostalgia - NCSA Mosiac
- Ghost means never having to touch /etc/hosts again
- Prism - command line and Ruby library parser for Microformats
- Pull! Skeet - Twitter Extension for Google Chrome
- QR - Easy Redis queues with Python
- Faye - dirt simple pub/sub for Rack and Node.js
- FOWA 2010: David Recordon on Facebook Open Source Projects
- Mongrations - migrations for MongoMapper






Add a retweet button to your Rails app easily with the Backtweets helper
On this blog, I use the excellent Socialize plugin to easily add social sharing buttons to each post. For Twitter, I chose to configure Socialize to use Backtweets for displaying tweet counts mainly because it’s more configurable than the TweetMeme widget.
When I needed a Backtweets widget for a client Rails application, I whipped up a quick plugin that provides an easy helper for writing all those JavaScript options.
Installation
You can install the plugin from the GitHub repo:
Displaying a tweet count in your view
To display a count of tweets that reference the current page, simply call the helper:
The full set of options include:
urltitlesrcviatruelinksfalsesize"large"api_keyshort_urlbackgroundbordertextDisplaying recent comments, blogroll and search
The plugin also includes three other helpers to render user comments and blogroll widgets as well as a comment search widget:
<%= backtweets_comments('pengwynn') -%> <%= backtweets_blogroll('pengwynn') -%> <%= backtweets_search('ruby') -%>If you would like to hit the Backtweets API for more info on your links and counts, check out the Twitterland gem.
Related posts: