tabalinas / jssocials

Social Network Sharing jQuery Plugin

Home Page:http://js-socials.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Twitter share count works!!

php5drvn opened this issue · comments

On site http://opensharecount.com/
I found that twits can be counted by this service. You just need to set up your domain on this site.
And change share twitter like this
twitter: {
label: "Tweet",
logo: "fa fa-twitter",
shareUrl: "https://twitter.com/share?url={url}&text={text}&via={via}&hashtags={hashtags}",
countUrl: "http://opensharecount.com/count.json?url={url}",
getCount: function (data) {
return data.count||0;
}
},

Thanks! Here's my code with reddit/instagram/flickr added...

$.extend(jsSocials.shares, {
	// Optional Twitter Count - https://opensharecount.com
	twitter: {
		label: "Tweet",
		logo: "fa fa-twitter",
		shareUrl: "https://twitter.com/share?url={url}&text={text}&via={via}&hashtags={hashtags}",
		countUrl: "https://opensharecount.com/count.json?url={url}",
		getCount: function (data) {
			return data.count||0;
		}
	},
	reddit: {
		label: "Reddit",
		logo: "fa fa-reddit",
		shareUrl: "https://www.reddit.com/submit?url={url}",
		countUrl: ""
	},
	instagram: {
		label: "Instagram",
		logo: "fa fa-instagram",
		shareUrl: "https://www.instagram.com/someuser/",
		countUrl: ""
	},
	flickr: {
		label: "Flickr",
		logo: "fa fa-flickr",
		shareUrl: "https://www.flickr.com/someuser/",
		countUrl: ""
	},
});
.jssocials-share-reddit .jssocials-share-link {
  background: #64a4ff; color: #fff !important; }
  .jssocials-share-reddit .jssocials-share-link:hover {
    background: #4585ee; color: #fff !important; }

.jssocials-share-instagram .jssocials-share-link {
  background: #405de6; color: #fff !important; }
  .jssocials-share-instagram .jssocials-share-link:hover {
    background: #5851db; color: #fff !important; }

.jssocials-share-flickr .jssocials-share-link {
  background: #0063dc; color: #fff !important; }
  .jssocials-share-flickr .jssocials-share-link:hover {
    background: #ff0084; color: #fff !important; }