Using the Facebook Graph API (v2.0), get only the notes published on the page

 

If you have a page facebook that contain some articles, a would to get them but when you do :


https://graph.facebook.com/v2.0/1432545087007695/notes?access_token=319440784873296|871VGrd1FxUDLTDeRMpfm0ndHxE

you have this result :

{
"error": {
"message": "(#12) notes API is deprecated for versions v2.0 and higher",
"type": "OAuthException",
"code": 12
}
}

And when you do :


https://graph.facebook.com/v2.0/1432545087007695/feed?access_token=319440784873296|871VGrd1FxUDLTDeRMpfm0ndHxE

you receive all the information about the page :

{
"data": [
{
"id": "1432545087007695_1433265710268966",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"picture": "https://scontent-a.xx.fbcdn.net/hphotos-xpa1/t1.0-9/s130x130/1521536_1433265766935627_9164966378403324602_n.jpg",
"link": "https://www.facebook.com/notes/bonjour/hello/1433265710268966",
"name": "hello",
"description": "deprecateddeprecateddeprecateddeprecateddeprecateddeprecateddeprecateddeprecateddeprecateddeprecated\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yY/r/1gBp2bDGEuh.gif",
"privacy": {
"value": ""
},
"type": "link",
"status_type": "created_note",
"application": {
"name": "Notes",
"id": "2347471856"
},
"created_time": "2014-06-11T11:20:52+0000",
"updated_time": "2014-06-11T11:20:52+0000"
},
{
"id": "1432545087007695_1433263763602494",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"picture": "https://fbcdn-photos-h-a.akamaihd.net/hphotos-ak-xpf1/t1.0-0/10325164_1433263880269149_978779895298362170_s.png",
"link": "https://www.facebook.com/notes/bonjour/62511111111111111111111/1433263763602494",
"name": "62511111111111111111111",
"description": "1222222222222222223649819641964194419541584158145141",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yY/r/1gBp2bDGEuh.gif",
"privacy": {
"value": ""
},
"type": "link",
"status_type": "created_note",
"application": {
"name": "Notes",
"id": "2347471856"
},
"created_time": "2014-06-11T11:13:52+0000",
"updated_time": "2014-06-11T11:13:52+0000",
"likes": {
"data": [
{
"id": "1432487507014191",
"name": "Chaimae Orbit"
}
],
"paging": {
"cursors": {
"after": "MTQzMjQ4NzUwNzAxNDE5MQ==",
"before": "MTQzMjQ4NzUwNzAxNDE5MQ=="
}
}
}
},
{
"id": "1432545087007695_1433228996939304",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"picture": "https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-xpa1/t1.0-0/10390156_1433229026939301_5536116692037351754_s.png",
"link": "https://www.facebook.com/notes/bonjour/trytrytr/1433228996939304",
"name": "trytrytr",
"description": "ytryrtyrty\n",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yY/r/1gBp2bDGEuh.gif",
"privacy": {
"value": ""
},
"type": "link",
"status_type": "created_note",
"application": {
"name": "Notes",
"id": "2347471856"
},
"created_time": "2014-06-11T09:26:25+0000",
"updated_time": "2014-06-11T09:26:25+0000"
},
{
"id": "1432545087007695_1433228876939316",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"message": "fjuuyktiy",
"privacy": {
"value": ""
},
"type": "status",
"status_type": "mobile_status_update",
"created_time": "2014-06-11T09:25:35+0000",
"updated_time": "2014-06-11T09:25:35+0000"
},
{
"id": "1432545087007695_1432929136969290",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"story": "Bonjour updated their cover photo.",
"story_tags": {
"0": [
{
"id": "1432545087007695",
"name": "Bonjour",
"offset": 0,
"length": 7,
"type": "page"
}
]
},
"picture": "https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-xfp1/t1.0-0/10303790_1432929123635958_3561739667982482211_s.png",
"link": "https://www.facebook.com/1432545087007695/photos/a.1432929133635957.1073741827.1432545087007695/1432929123635958/?type=1&relevant_count=1",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif",
"privacy": {
"value": ""
},
"type": "photo",
"object_id": "1432929123635958",
"created_time": "2014-06-10T08:22:51+0000",
"updated_time": "2014-06-10T08:22:51+0000"
},
{
"id": "1432545087007695_1432656033663267",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"message": "Nouvaut\u00e9",
"privacy": {
"value": ""
},
"type": "status",
"status_type": "mobile_status_update",
"created_time": "2014-06-09T08:49:14+0000",
"updated_time": "2014-06-09T08:49:14+0000"
},
{
"id": "1432545087007695_1432545103674360",
"from": {
"category": "Community",
"name": "Bonjour",
"id": "1432545087007695"
},
"story": "Bonjour joined Facebook.",
"story_tags": {
"0": [
{
"id": "1432545087007695",
"name": "Bonjour",
"offset": 0,
"length": 7,
"type": "page"
}
]
},
"privacy": {
"value": ""
},
"type": "status",
"application": {
"name": "Reviews",
"id": "6261817190"
},
"created_time": "2014-06-08T21:42:17+0000",
"updated_time": "2014-06-08T21:42:17+0000"
}
],
"paging": {
"previous": "https://graph.facebook.com/v2.0/1432545087007695/feed?access_token=319440784873296|871VGrd1FxUDLTDeRMpfm0ndHxE&limit=25&since=1402485652&__previous=1",
"next": "https://graph.facebook.com/v2.0/1432545087007695/feed?access_token=319440784873296|871VGrd1FxUDLTDeRMpfm0ndHxE&limit=25&until=1402263736"
}
}

It’s prove that you can communicate with your page, but how can you get only the notes?

 

yes, we can.

we could find these notes that have “applications” property, and the “applications” has “name” property that called “Notes”.
we can identify the notes by this condition.

by PHPthinking.

 

打赏此文

如果您觉得本站的内容对您有所帮助,您可以扫描下面的二维码小额支付请我喝杯茶,感谢!打赏记录
支付宝
微信
承诺:凡打赏捐助的朋友,留言备注自己的邮箱,在打赏捐助时间点的6个月内,本站会每周邮件推送原创专业技术博文,供大家学习和参考!

4 条评论

  1. 见血封喉说道:

    英文不好,有中文的就好了

  2. 新手说道:

    大牛,有联系方式吗?

留下评论

All fields marked (*) are required