Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

social_sharer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

social_sharer

  • 0.1.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 11 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc