Cody Piersall
Cody Piersall

Reputation: 8547

Best way to get all the posts on a group's wall on Facebook

There is a group on Facebook called Pointless Haiku. I would like to download all of the posts that have ever been posted to the group's wall so I can entertain myself with random haiku for hours. So far I have used the graph explorer with this fql query (is that the right terminology?): 2204535003?fields=feed.limit(10000).fields(message), and it gives me some of the wall posts but not all of them (not even the first 10000, which is the limit I set). I don't have a Facebook app, because the only reason I want to do this is to amuse myself. Once I get all of the posts I'll probably just write them to a file and do some postprocessing with Python.

What is the best way to accomplish this? Do I need to create an app just to do this, if I want to do it programmatically?

Upvotes: 0

Views: 2256

Answers (2)

Stephen Ferg
Stephen Ferg

Reputation: 11

About your observation that it gives me some of the wall posts but not all of them (not even the first 10000, which is the limit I set)

I think that the Graph Explorer is meant to be a development and debugging tool (sort of like Python's IDLE) rather that a full-power query engine. As such, I believe that it has its own built-in page-size limit that cannot be over-ridden. I believe that limit is 25. Note that this is not the limit of the number of results that are returned. It is the maximum number of results that will be displayed on one page. Depending on the size of your results set, it may take several, or many, pages to display the entire set.

So... if you are in Graph Explorer, and run a query, and get back your results, if you scroll down to the bottom of the results produced by Graph Explorer, you may see something like this:

  "paging": {
    "previous": "https://graph.facebook.com/...",
    "next": "https://graph.facebook.com/... "
  }

If you click on the URL following the "next" label, it will take you to the next page of results. And if you keep doing that, eventually you will click your way through all of the pages with all of your results.

I think that the way to get ALL of your results at a single shot is to submit the GET request (which Graph Explorer has helped you to create and debug) programmatically via (say) a Python script, or some other kind of script.

Just as an example, I used this query to get back a list of all of the messages and comments posted to a Facebook group since January 1, 2015. (I ran this query successfully on May 8, 2016, using Graph Explorer v2.6.)

128791213885003/?fields=name,id,description,owner,feed.since(2015-01-01){message,created_time,comments{from,message,created_time,comments{from,message,comments{from,message}}}}

I hope this helps.

Upvotes: 1

Umair A.
Umair A.

Reputation: 6873

You can use Graph Explorer for that.

  1. /me/groups can bring group ids
  2. /group-id/feed will bring groups feeds

Don't forget to Get Access Token with user_groups permission.

Upvotes: 0

Related Questions