Don't show StumbleUpon share count
koddr opened this issue · comments
Vic Shóstak commented
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 :
Vic Shóstak commented
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!