我正在运行一个Wordpress博客,并在单个帖子模板上使用默认的facebook类按钮。
<fb:like href="<?php echo get_permalink(); ?>" send="false" width="80" height="20" layout="button_count" show_faces="false" font="arial"></fb:like>
这些按钮上的数字显示正确。
我还通过将链接传递给Graph API来保存facebook计数以发布元数据:
'http://graph.facebook.com/?ids=' . get_permalink()
这没关系,但最近我注意到相同的号码不再保存到帖子元数据中。虽然类似按钮上的数字显示正确。
为了检查数字不再保存到帖子元数据的原因,我打开了
http://graph.facebook.com/?ids=http://blog.com/2011/07/04/post-name/
在我的浏览器中。结果如下:
{
"http://blog.com/2011/07/04/post-name/": {
"id": "284885928194873",
"name": "Post Name",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/276621_284885928194893_1295441978_s.jpg",
"link": "http://blog.com/2011/07/04/post-name/",
"likes": 1,
"category": "Personal blog",
"description": "Post Description",
"parking": {
"street": 0,
"lot": 0,
"valet": 0
},
"hours": {
"mon_1_open": 0,
"mon_1_close": 0,
"tue_1_open": 0,
"tue_1_close": 0,
"wed_1_open": 0,
"wed_1_close": 0,
"thu_1_open": 0,
"thu_1_close": 0,
"fri_1_open": 0,
"fri_1_close": 0,
"sat_1_open": 0,
"sat_1_close": 0,
"sun_1_open": 0,
"sun_1_close": 0,
"mon_2_open": 0,
"mon_2_close": 0,
"tue_2_open": 0,
"tue_2_close": 0,
"wed_2_open": 0,
"wed_2_close": 0,
"thu_2_open": 0,
"thu_2_close": 0,
"fri_2_open": 0,
"fri_2_close": 0,
"sat_2_open": 0,
"sat_2_close": 0,
"sun_2_open": 0,
"sun_2_close": 0
},
"payment_options": {
"cash_only": 0,
"visa": 0,
"amex": 0,
"mastercard": 0,
"discover": 0
},
"restaurant_services": {
"reserve": 0,
"walkins": 0,
"groups": 0,
"kids": 0,
"takeout": 0,
"delivery": 0,
"catering": 0,
"waiter": 0,
"outdoor": 0
},
"restaurant_specialties": {
"breakfast": 0,
"lunch": 0,
"dinner": 0,
"coffee": 0,
"drinks": 0
},
"can_post": true
}
}
我从未收到过这样的结果。我不知道parking
或restaurant_specialties
在这里做了什么。
但是,在传递相同的帖子网址但使用www
:
http://graph.facebook.com/?ids=http://www.blog.com/2011/07/04/post-name/
我得到了实际应该有的东西:
{
"http://www.blog.com/2011/07/04/post-name/": {
"id": "http://www.blog.com/2011/07/04/post-name/",
"shares": 4
}
}
Facebook有什么问题吗?我可以做什么,以便我可以像以前那样继续将Facebook数字保存到后元数据中?
答案 0 :(得分:0)
由于ID是您网页的识别密钥,因此www
是否存在重要。
我相信您必须使用与创建类似按钮相同的固定链接。