最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get id or name of a facebook user when it share my link - Stack Overflow

programmeradmin0浏览0评论

i'm developing a page in with there are many facebook share button.

My page has url like:

what i like to do is to get info about the user that is sharing my page instead to have

;name=Name%20Surname

so i can put that name in my page like for example:

The user Name Surname has shared this page.. share that page you too!

Is possible? Thanks!!!

i'm developing a page in with there are many facebook share button.

My page has url like: http://mydomain./follow/show_info?id=xxxx

what i like to do is to get info about the user that is sharing my page instead to have

http://mydomain./follow/show_info?id=xxxx&name=Name%20Surname

so i can put that name in my page like for example:

The user Name Surname has shared this page.. share that page you too!

Is possible? Thanks!!!

Share Improve this question asked Sep 21, 2012 at 9:19 JayyrusJayyrus 13.1k41 gold badges135 silver badges215 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4
FB.api('/me', function(response) {
    alert("Name: "+ response.name + "\nFirst name: "+ response.first_name + "ID: "+response.id);
    var img_link = "http://graph.facebook./"+response.id+"/picture"
});

by this you can extract current logedin user uid and name and image what you have to do when someone triger for share catch these by java script

here are some more link which will help you more

http://developers.facebook./docs/reference/api/user/

http://developers.facebook./docs/reference/javascript/

and

http://developers.facebook./docs/reference/javascript/FB.api/

发布评论

评论列表(0)

  1. 暂无评论