Skip to content

A simple javascript class that allows for easy social sharing

Notifications You must be signed in to change notification settings

DrewDahlman/Social-Sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Social Sharing

An easy javascript class for easy custom social sharing.

Requirements

Facebook
Register an app with facebook http://developer.facebook.com
Get the App ID
Be sure to include the Facebook Javascript SDK
Set the App domain in the Facebook app settings.
You need to set your app to public for normal users to use the facebook share

FORMATTING AND DATA

Facebook: Accepts custom inputs and formatting

Twitter: Accepts custom inputs and formatting, link will always be the last part of the tweet. If you want the link to be within the tweet don't include a link.

Twitter: Accepts custom inputs and formatting

LinkedIn: Accepts custom inputs and formatting

g+: Scrapes your page according to the URL passed. This looks at the meta tags.

	`
	
	
	
	
	`

How to use

Create the sharer

var sharer = new SocialShare();

Create a share object which will look like this -

var share_obj = {
	method: "feed",
	link: "LINK TO SHARE",
	picture: "URL TO IMAGE MUST BE ABSOLUTE PATH",
	name: "THE NAME DISPLAYED",
	caption: "THE CAPTION",
	description: "THE DESCRIPTION"
}

For Facebook:

sharer.facebook_share(share_obj);

For Twitter:

sharer.twitter_share(share_obj)

For LinkedIn:

sharer.linkedin_share(share_obj)

For g+:

sharer.google_share(share_obj)

For Pinterest:

sharer.pinterest_share(share_obj)

About

A simple javascript class that allows for easy social sharing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published