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.

Home Page:sharrre.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't show StumbleUpon share count

koddr opened this issue · comments

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 :

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!