Mephisto Share It
Author: William Wong Garay Blog: http://www.willywg.com E-Mail: willywg@gmail.com Support: http://www.willywg.com/2007/3/25/mephisto-share-it-plugin (Documentation in English and Spanish) Testing in: Mephisto 1.0
>>What is this?<<
Mephisto Share It is a plugin that provides an unobtrusive way for your visitors to add your post to various social bookmarking sites.
>>Installation<<
1. Download the plugin archive from http://www.willywg.com/2007/3/25/mephisto-share-it-plugin.
2. Unrar the file mephisto_share_it.rar and put the 'mephisto_share_it' folder into your vendor/plugins/ directory. Afterward, you should have a folder structure like this: vendor/plugins/mephisto_share_it/(a bunch of files).
3. Finally restart your application of mephisto.
>>Using<<
1. Personalizing. Open the mephisto_share_it.rb file in your vendor/plugins/mephisto_share_it/lib/ directory and change this data:
HOST = 'http://www.willywg.com' #A. Change it for your website
. Activate the markers to use assigning them the true value and disable them with false nternational Bookmarks DELICIOUS = true
DIGG = true
TECHNORATI = true
GOOGLE_BOOKMARKS = true
YAHOO_MY_WEB = true
MAGNOLIA = true
ispanic Bookmarks MENEAME = false
FLOREAME = false
ENCHILAME = false
WEBEAME = false
2. Drawing. Do this in your layout (for default values):
{{ article | share_it }}
This will generate:
Share It: »del.icio.us »Digg »Technorati »Google Bookmarks »Yahoo My Web »Ma.gnolia
Or use:
{{ article | share_it: 'Share this post','' }}
This will generate:
Share this post del.icio.us Digg Technorati Google Bookmarks Yahoo My Web Ma.gnolia
3. If you want to use the bookmarkers separately you can make it in the following way:
{{ article | link_to_delicious }} or {{ article | link_to_delicious: 'Bookmark this with del.icio.us' }}
Same way with link_to_digg, link_to_technorati, link_to_google_bookmarks, link_to_yahoo_my_web, link_to_magnolia, link_to_meneame, link_to_floreame, link_to_enchilame and link_to_webeame
>>Adding a bookmarker<<
This is simple:
1. Add a bookmarker with the true value:
MY_BOOKMARKER = false
2. Create a function:
def link_to_my_bookmarker(article, text = nil)
url = 'http://my_bookmarker.com/post?' #the url of the bookmarker site
url += "url=#{HOST}#{article'url'}&title=#{article'title'}" #the values by get
content_tag :a, text || 'My Bookmarker', :href => url, :target => 'blank' #the tag A generated with the Bookmarker name
end
3. Adds the following line in the function share_it:
links += pre + link_to_my_bookmarker(article) + ' ' if MY_BOOKMARKER