= Addthis Addthis.com provides widgets that make sharing, bookmarking and emailing pages, and subscribing to feeds easy for your visitors. It supports a broad range of social network sites and web applications. This plugin makes it easy to add plain or customized Addthis.com widgets to your Rails application. = Installation As a Gem in environment.rb: config.gem 'jaap3-addthis', :lib => 'addthis', :source => 'http://gems.github.com' As a plugin: script/plugin install git://github.com/jaap3/addthis.git = Quick Start The most basic use is simply providing no arguments: addthis_bookmark_button addthis_email_button The code generated by Addthis will then try to figure out the url and title by itself. This is not possible for addthis_feed_button. You can set a custom url, this is required for addthis_feed_button: addthis_bookmark_button("http://www.example.com/") addthis_email_button("http://www.example.com/") addthis_feed_button("http://www.example.com/") Setting a title is possible when adding a bookmark or email button: addthis_bookmark_button("http://www.example.com/", "Example website") addthis_email_button("http://www.example.com/", "Example website") To only set a custom title you can use to options hash: addthis_bookmark_button(:title => "Example title") addthis_email_button(:title => "Example title") The options hash can be used to customize the widget to a great extend. Each of the shown examples can take the options hash as an optional extra argument. = Usage If you wish to track analytics for your button, you must create an account at http://addthis.com/. Joining is free! After signing up create a new ruby file in config/initializers called addthis.rb. You can use this file to configure your publisher name (your Addthis.com username) like so: Jaap3::Addthis::CONFIG[:publisher] = "YOUR_USERNAME_HERE" You can then use this initializer to further override any other settings you might like. The default settings are stored in the following constants. You can look in the source to see what they are. Jaap3::Addthis::CONFIG Jaap3::Addthis::DEFAULT_OPTIONS Jaap3::Addthis::BOOKMARK_BUTTON_DEFAULTS Jaap3::Addthis::FEED_BUTTON_DEFAULTS Jaap3::Addthis::EMAIL_BUTTON_DEFAULTS Besides overriding the default settings using the initializer, each helper method takes an options hash that can be used to override any setting for a specific button. So calling addthis_bookmark_button(:publisher => "example", :secure => true) Will output a button usable on https pages with the publisher variable set to "example" regardless of any configuration changes. = Contributing If you would like to contribute to the Addthis plugin, just fork the code and send me a pull request after you are done fiddling. == Copyright Copyright (c) 2009 Jaap Roes. See LICENSE for details.