Pshtiwan KarDo
Pshtiwan KarDo

Reputation: 87

How to get Facebook posts of a page with its comments?

How to get Facebook posts of a page with its comments to my webpage? I saw it from http://rudaw.net/english in sidebar and they apply custom style for it like that:

enter image description here

I saw graph of Facebook, that is JSON of one of pages:

    {
       "id": "411891885531368",
       "about": "\u0626\u0627\u0645\u0627\u0646\u062c\u0645\u0627\u0646 \u062e\u0632\u0645\u0647\u200c\u062a \u06a9\u0631\u062f\u0646\u06cc \u0626\u06ce\u0648\u0647\u200c\u06cc\u0647\u200c",
       "can_post": false,
       "category": "Computers/internet website",
       "checkins": 109,
       "cover": {
          "cover_id": 693427407377813,
          "offset_x": 0,
          "offset_y": 0,
          "source": "https://scontent-b.xx.fbcdn.net/hphotos-xpa1/t1.0-9/s720x720/10501938_693427407377813_8236762689196644851_n.png"
       },
       "description": "\u0633\u06d5\u0631\u062f\u0627\u0646\u06cc \u0645\u0627\u06b5\u067e\u06d5\u0695\u06cc \u06a9\u06ce\u0634\u06d5\u06cc \u06a9\u0648\u0645\u067e\u06cc\u0648\u062a\u06d5\u0631 \u0628\u06a9\u06d5:\n\nhttp://www.pkurd.com/ku/",
       "has_added_app": false,
       "is_community_page": false,
       "is_published": true,
       "likes": 358257,
       "link": "https://www.facebook.com/computer.problem1",
       "name": "\u0643\u06cc\u0634\u0629\u06cc \u0643\u06c6\u0645\u067e\u06cc\u0648\u062a\u0629\u0631",
       "parking": {
          "lot": 0,
          "street": 0,
          "valet": 0
       },
       "phone": "07503085828",
       "talking_about_count": 658972,
       "username": "computer.problem1",
       "website": "http://www.pkurd.com/ku/",
       "were_here_count": 0
    }

I want to get posts and comments of this page like rudaw's getting, how to do that?

Upvotes: 0

Views: 136

Answers (1)

Bitanshu Das
Bitanshu Das

Reputation: 627

I know how to do it using R. You have to install a package Rfacebook. Then use function :

x<-getPage(page="pagename",token = access_token, n = no. of posts)

This will give all the posts and post ids. Now use function

y<-getPost(post = x$id[1], n = number of comments and likes, token = access_token)

You can use a loop to get all the comments.

Upvotes: 1

Related Questions