facebook and twitter share count
I have a web site that includes photo gallery of every users submission and all the photo can be share on Facebook and twitter. I 开发者_如何转开发just want know if its possible to track back how many people actually shared for each photos. I just used share.php?myurl for sharing.
I have some problems with this. I use the javascript api... and graph api (php)
to share the article I use
FB.ui({method:'feed', link:'http://www.mysite.com/the-article-slug'});
When I post the article... I see in facebook correctly added... with link... image... all is OK.
But when I try to retrieve the count share of this article I use php (@zaw, maybe you can use this method too):
http://graph.facebook.com/?id=http://www.mysite.com/the-article-slug
But I see zero count.
But... When I share this URL using www.facebook.com directly... works fine... the count updates.
Why I using FB.ui ? because this method have javascript method to listen if the post are complete...
Anybody knows the way to get correctly the share count ?
The following code was worked fine for me
FB.ui(
{
method: 'stream.share',
href: 'your url',
},
for checking share or likes count, if you use special characters like '?', '=' (query string in yoururl) use"urlencode"php function.
E.g.:http://graph.facebook.com/https3A%2F2Fwww.example.com%2Fsomedomain%2Fsomepage.php%3Fvariable%3Dvalue
精彩评论