Julienh / Sharrre

Make your sharing widget! Sharrre is a jQuery plugin that allows you to create nice widgets sharing for Facebook, Twitter, Google Plus (with PHP script) and more.
sharrre.com
MIT License
1.04k stars 413 forks source link

Don't show StumbleUpon share count #255

Closed koddr closed 8 years ago

koddr commented 8 years ago

Why not work this URL? http://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}&format=jsop&callback=?

Try to get count from this code:

$.getJSON('http://www.stumbleupon.com/services/1.01/badge.getinfo?url=' + encodeURIComponent(location.href) + '&format=jsonp&callback=?', function(response) {
  console.log(response.result.views);
});

Always request this error:

badge.getinfo?url={url}&format=jsonp&callback=jQuery111208967753052711487_14431125277…:1
Uncaught SyntaxError: Unexpected token :
koddr commented 8 years ago

Also I try get share count from StumbleUpon on my site:

$.getJSON('http://www.stumbleupon.com/services/1.01/badge.getinfo?url=' + encodeURIComponent(location.href) + '&callback=?', function(response) {
  var getResult = 'result';
  for (var getResult in response) {
    if (response.hasOwnProperty(getResult)) {
      var count = response.getResult.views;
      break;
    }
  }
  console.log(count);
});

But error message still here:

badge.getinfo?url={url}&callback=jQuery11120638845409732312_14430823…:1 
Uncaught SyntaxError: Unexpected token :

Any ideas? Help me please, if you can!