Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bcr_url = window.location, facebook_share(bcr_url);
- twitter(bcr_url);
- linkedin(bcr_url);
- google(bcr_url);
- upon(bcr_url);
- pinterest(bcr_url);
- reddit(bcr_url);
- function facebook_share(b) {
- $.ajax({
- url: 'http://api.facebook.com/method/fql.query?format=json&query=SELECT%20url,%20share_count%20FROM%20link_stat%20WHERE%20url%20=%20%22' + b + '%22',
- crossDomain: true,
- dataType: 'jsonp'
- }).done(function(a) {
- html = '';
- html += '<a href="http://www.facebook.com/sharer/sharer.php?u=' + bcr_url + '" class="btn btn-fb" title="Share this on Facebook - ibacor.com" target="_BLANK"><i class="fa fa-facebook"> ' + a[0].share_count + '</i></a>';
- $('#bcr_fs').html(html)
- })
- }
- function twitter(b) {
- $.ajax({
- url: 'http://urls.api.twitter.com/1/urls/' + 'count.json?url=' + b,
- crossDomain: true,
- dataType: 'jsonp'
- }).done(function(a) {
- html = '';
- html += '<a href="https://twitter.com/share?text=' + $(document).find("title").text().replace(/ /g, '+') + '&url=' + bcr_url + '" class="btn btn-tw" title="Share this on Twitter - ibacor.com" target="_BLANK"><i class="fa fa-twitter"> ' + a.count + '</i></a>';
- $('#bcr_tw').html(html)
- })
- }
- function google(b) {
- $.ajax({
- url: pehape + '?gog=' + b,
- crossDomain: true,
- dataType: 'json'
- }).done(function(a) {
- html = '';
- html += '<a href="https://plus.google.com/share?url=' + bcr_url + '" class="btn btn-gp" title="Share this on Google+ - ibacor.com" target="_BLANK"><i class="fa fa-google-plus"> ' + a.kon + '</i></a>';
- $('#bcr_go').html(html)
- })
- }
- function linkedin(b) {
- $.ajax({
- url: 'http://www.linkedin.com/countserv/count/share?url=' + b,
- crossDomain: true,
- dataType: 'jsonp'
- }).done(function(a) {
- html = '';
- html += '<a href="http://www.linkedin.com/shareArticle?mini=true&ro=true&trk=' + $(document).find("title").text().replace(/ /g, '+') + '&url=' + bcr_url + '" class="btn btn-in" title="Share this on Linkedin - ibacor.com" target="_BLANK"><i class="fa fa-linkedin"> ' + a.count + '</i></a>';
- $('#bcr_in').html(html)
- })
- }
- function upon(b) {
- $.ajax({
- url: pehape + '?upo=' + b,
- crossDomain: true,
- dataType: 'json'
- }).done(function(a) {
- html = '';
- html += '<a href="http://www.stumbleupon.com/badge/?url=' + bcr_url + '" class="btn btn-up" title="Share this on Stumbleupon - ibacor.com" target="_BLANK"><i class="fa fa-stumbleupon"> ' + a.kon + '</i></a>';
- $('#bcr_up').html(html)
- })
- }
- function reddit(b) {
- $.ajax({
- url: 'http://www.reddit.com/api/info.json?url=' + b,
- crossDomain: true,
- dataType: 'json'
- }).done(function(a) {
- html = '';
- if (a.data.children != '') {
- html += '<a href="http://reddit.com/submit?url=' + bcr_url + '&title=' + $(document).find("title").text().replace(/ /g, '+') + '" class="btn btn-rd" title="Share this on Reddit - ibacor.com" target="_BLANK"><i class="fa fa-reddit"> ' + a.data.children[0].data.score + '</i></a>';
- $('#bcr_rd').html(html)
- } else {
- html += '<a href="http://reddit.com/submit?url=' + bcr_url + '&title=' + $(document).find("title").text().replace(/ /g, '+') + '" class="btn btn-rd" title="Share this on Reddit - ibacor.com" target="_BLANK"><i class="fa fa-reddit"> 0</i></a>';
- $('#bcr_rd').html(html)
- }
- })
- }
- function pinterest(b) {
- $.ajax({
- url: 'https://api.pinterest.com/v1/urls/count.json?url=' + b,
- crossDomain: true,
- dataType: 'jsonp'
- }).done(function(a) {
- html = '';
- html += '<a href="http://pinterest.com/pin/create/button/?url=' + bcr_url + '&media=' + $('meta[property="og:image"]').attr('content') + '" class="btn btn-pn" title="Share this on Pinterest - ibacor.com" target="_BLANK"><i class="fa fa-pinterest"> ' + a.count + '</i></a>';
- $('#bcr_pt').html(html)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement