Mephisto Share It Plugin
Posted by willywg, Sun Mar 25 19:11:00 UTC 2007
[Ir a la documentación en Español]
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
- Download the plugin archive from http://www.willywg.com/assets/2007/3/25/mephisto_share_it.rar
- 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).
- 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
#B. Activate the markers to use assigning them the true value and disable them with false
#International Bookmarks
DELICIOUS = true
DIGG = true
TECHNORATI = true
GOOGLE_BOOKMARKS = true
YAHOO_MY_WEB = true
MAGNOLIA = true
#Hispanic 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: »<a href="http://del.icio.us/post?url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">del.icio.us</a> »<a href="http://digg.com/submit?phase=2&url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Digg</a> »<a href="http://www.technorati.com/faves?add=http://www.willywg.com/2007/3/25/your_post" target="_blank">Technorati</a> »<a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Google Bookmarks</a> »<a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.willywg.com/2007/3/25/your_post&t=YourPost" target="_blank">Yahoo My Web</a> »<a href="http://ma.gnolia.com/bookmarklet/add?url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Ma.gnolia</a>
Or use:
{{ article | share_it: 'Share this post','' }}
This will generate:
Share this post <a href="http://del.icio.us/post?url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">del.icio.us</a> <a href="http://digg.com/submit?phase=2&url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Digg</a> <a href="http://www.technorati.com/faves?add=http://www.willywg.com/2007/3/21/hola" target="_blank">Technorati</a> <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Google Bookmarks</a> <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.willywg.com/2007/3/21/hola&t=Hola" target="_blank">Yahoo My Web</a> <a href="http://ma.gnolia.com/bookmarklet/add?url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Ma.gnolia</a>
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 = true
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 share_it function:
links += pre + link_to_my_bookmarker(article) + ' ' if MY_BOOKMARKER
¿Qué es?
Mephisto Share It es un plugin que permite que tus visitantes agreguen tus mensajes publicados (posts) a los marcadores de noticias más conocidos.
Instalación
- Descárgate el plugin desde http://www.willywg.com/assets/2007/3/25/mephisto_share_it.rar
- Descomprime el archivo mephisto_share_it.rar y copia la carpeta 'mephisto_share_it' en la ruta vendor/plugins/ quedando de la siguiente manera: vendor/plugins/mephisto_share_it/.
- Finalmente reinicia tu aplicación de mephisto.
Uso
1. Personalizando. Abre el archivo mephisto_share_it.rb localizado en el directorio vendor/plugins/mephisto_share_it/lib/ y edita los siguientes datos:
HOST = 'http://www.willywg.com' #A. Cámbialo por tu website
#B. Activa los marcadores que usarás asignándoles el valor true y desactívalos con false
#Marcadores Internacionales
DELICIOUS = true
DIGG = true
TECHNORATI = true
GOOGLE_BOOKMARKS = true
YAHOO_MY_WEB = true
MAGNOLIA = true
#Marcadores Hispanos
MENEAME = false
FLOREAME = false
ENCHILAME = false
WEBEAME = false
2. Mostrando. Agrega este código en tu diseño (para valores por defecto):
{{ article | share_it }}
Esto generará:
Share It: »<a href="http://del.icio.us/post?url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">del.icio.us</a> »<a href="http://digg.com/submit?phase=2&url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Digg</a> »<a href="http://www.technorati.com/faves?add=http://www.willywg.com/2007/3/25/your_post" target="_blank">Technorati</a> »<a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Google Bookmarks</a> »<a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.willywg.com/2007/3/25/your_post&t=YourPost" target="_blank">Yahoo My Web</a> »<a href="http://ma.gnolia.com/bookmarklet/add?url=http://www.willywg.com/2007/3/25/your_post&title=YourPost" target="_blank">Ma.gnolia</a>
O usa:
{{ article | share_it: 'Compártelo: ','' }}
Esto generará:
Compártelo: <a href="http://del.icio.us/post?url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">del.icio.us</a> <a href="http://digg.com/submit?phase=2&url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Digg</a> <a href="http://www.technorati.com/faves?add=http://www.willywg.com/2007/3/21/hola" target="_blank">Technorati</a> <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Google Bookmarks</a> <a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.willywg.com/2007/3/21/hola&t=Hola" target="_blank">Yahoo My Web</a> <a href="http://ma.gnolia.com/bookmarklet/add?url=http://www.willywg.com/2007/3/21/hola&title=Hola" target="_blank">Ma.gnolia</a>
3. Si deseas usar los marcadores de manera separada puedes hacerlo de la siguiente manera:
{{ article | link_to_delicious }} or {{ article | link_to_delicious: 'Márcalo con del.icio.us' }}
Puedes hacerlo de la misma manera con 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 y link_to_webeame
Agregando un marcador
Es muy simple hacelo:
1. Agrega un nombre de marcador y asígnale un valor true:
MI_MARCADOR = true
2. Crea la función que llame al marcador:
def link_to_mi_marcador(article, text = nil)
url = 'http://mi-marcador.com/post?' #La dirección web del marcador
url += "url=#{HOST}#{article['url']}&title=#{article['title']}" #Los valores pasados por el método get
content_tag :a, text || 'Mi marcador', :href => url, :target => '_blank' #La etiqueta que generará el marcador
end
3. Agrega la siguiente línea de código en la función share_it:
links += pre + link_to_mi_marcador(article) + ' ' if MI_MARCADOR
