New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

goodshare.js

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

goodshare.js

Useful modern JavaScript solution that will help your website visitors share a link on social networks and microblogs. Easy to install and configuring on any of your website!

  • 4.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242
decreased by-49.37%
Maintainers
1
Weekly downloads
 
Created
Source

goodshare.js logo github

goodshare.js

Useful jQuery plugin modern JavaScript solution that will help your website visitors share a link on social networks and microblogs or mobile messengers. Easy to install and configuring on any of your website!

Warning! Since 4.0.0 we don't support old jQuery versions of goodshare.js. Thank you jQuery, but ES6 is better and cleaner.

Features

Simple install, extensive documentation, developer support, SEO friendly, many options for customization of appearance, clean code without scripts tracking user activity on the page, high speed.

$ npm install goodshare.js

Old way to install

Download goodshare.min.js and place file to your project template (before close body tag):

<!-- goodshare.js minify version -->
<script src="/path/to/goodshare.min.js"></script>

List of supported social networks and microblogs

Note: If you don't see your social network, please let us know and we'll try to add it!

For iOS/Android mobile devices

Description

Plugin works with any HTML tags: <a> or <div> or <button> or other. So you can choose any and add required attributes data-social. For example:

<!-- Create button with share to Twitter -->
<button data-social="twitter">Share this to Twitter</button>

<!-- Create link with share to Facebook -->
<a href="#" data-social="facebook">Share this to Facebook</a>

<!-- Create div container with share to LinkedIn -->
<div data-social="linkedin">Share this to LinkedIn</div>

<!-- Create icon from Fontello.com with share to Google+ -->
<i class="icon-google-plus" data-social="googleplus"></i>

We use event.preventDefault() for event «click». So don't be afraid to use links like this:

<a href="#" data-social="...">My link</a>

Counters

To display counter, just add data-counter attribute to HTML element that will contain numbers. For example:

<!-- Create link with share to Facebook and counter -->
<a href="#" data-social="facebook">
  Share this to Facebook
  <span data-counter="facebook"></span>
</a>

Note: You also may put this attribute to any element.

Value of data-counter attribute, see in this list of supported social networks and microblogs:

Note: Google Plus, Surfingbird, StumbleUpon, Pocket and Xing counters use Yahoo Query Language (YQL). It may impose some restrictions on use, associated with limit queries to Yahoo (we try to find another solution for this, if you know — write issue to us).

How to get Twitter share counter after API 1.1 changes?

Simple solution for single domain: http://opensharecount.com

Note: We're not authors of the web site opensharecount.com, if something not working — write to their support please!

Example

This example shows one of decoration options with all supported social networks.

goodshare.js usage example github

Developers

Development and maintenance of goodshare.js project engaged by Vikky Shostak (Koddr). If you want to write a «thank you» or ask us about something, use this e-mail.

Your help

If you want help, we will be glad reviews about goodshare.js on personal blogs (including Twitter), online media and/or specialized IT-portals. Thank you!

License

The MIT License (MIT)

Keywords

FAQs

Package last updated on 21 Dec 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