0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Adds a set of view methods that allow the users to create sharing buttons for multiple platforms. This gem allows you to customise the url for each platform adding 'tracking' string if required.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 0.10.2
~> 0.2.4
~> 0.9.6
~> 3.0
~> 0.34.2
~> 0.10.0
~> 0.8.7.6

Runtime

~> 4.2
 Project Readme

Social Sharer Logo

By BD Network.

Social Sharer is a Ruby on Rails Gem, allowing you to easily create Twitter and Facebook share dialogues.

Build status Gem Version Code Coverage License

Key Features

  • Easy to configure
  • Easy to style
  • Kept up to date with changes share systems.

Getting Started

Installation

Add this to your gemfile within your Rails project:

gem 'social_sharer', '0.1.4'

Options

Single share URL

If you require a single URL to be shared across both social networks but require simple tracking, e.g. for Google Analytics you can use the options listed below:

{
  url: 'http://thisisbd.com/',
  twitter_message: 'This%20is%20BD'
}

This would have Facebook link to: http://thisisbd.com/?src=fb and your tweet contents would be: This is BD http://thisisbd.com/?src=tw

You may also add an (optional) Twitter handle to be included into the message:

{
  url: 'http://thisisbd.com/',
  twitter_handle: '@thisisbd',
  twitter_message: 'This%20is%20BD'
}

Your tweet contents would be: This is BD via @thisisbd http://thisisbd.com/?src=tw

Multiple share URLs

If you provide different URLs for each social network, or want more flexible control over the URLs users are sharing, these options are for you:

{
  individual_settings: true,

  twitter: {
    url: 'http://thisisbd.com/twitter_url',
    message: 'This%20is%20BD'
  },

  facebook: {
    url: 'http://thisisbd.com/facebook_url'
  }
}

This would have Facebook link to: http://thisisbd.com/facebook_url and your tweet contents would be: This is BD http://thisisbd.com/twitter_url

You may also add an (optional) Twitter handle to be included into the message:

{
  individual_settings: true,

  twitter: {
    url: 'http://thisisbd.com/twitter_url',
    handle: '@thisisbd',
    message: 'This%20is%20BD'
  },

  facebook: {
    url: 'http://thisisbd.com/facebook_url'
  }
}

This would have Facebook link to: http://thisisbd.com/facebook_url and your tweet contents would be: This is BD via @thisisbd http://thisisbd.com/twitter_url

View Helper

Within your view:

<%= social_share_tags( @social_sharer_options ) %>

Requirements

Social Sharer requires Ruby on Rails and has been tested on 4.x.

Contributing

If you wish to submit a bug fix or feature, you can create a pull request and it will be merged pending a code review.

  1. Clone it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

Social Sharer is licensed under the MIT License.