Get data from a facebook page wall or group wall for use on personal website

前端 未结 4 1376
遥遥无期
遥遥无期 2021-01-31 06:14

I want to connect to public facebook page or group and list all entries from the wall on a personal website. I will use PHP on my server so that would be the best solution for m

4条回答
  •  臣服心动
    2021-01-31 06:40

    use the facebook graph api urls that they provide

    python code using simplejson parser

    keyword="old spice"
    searchurl='http://graph.facebook.com/search?q='+keyword
    resp=urllib2.urlopen(searchurl)
    pageData=resp.read()
    json = simplejson.loads(pageData)
    posts=json['data']
    for p in posts:
        postid=p['id']
        username=p['from']['name']
        posterimg=p['icon']
        comment=p['message']
    

提交回复
热议问题