Facebook Comments for Research
This is a post about (at least temporary) failure. I should be able to do all this via the Facebook API/SDK but I’m doing something wrong. While I’m learning a decent amount in the land of programming, fundamentally I still suck.
With that cathartic self-flagellation out of the way . . .
I’m working with someone who wants to grab all the comments from a large number of CDC posts about health issues for some research. She is currently doing it by hand. Here are two improvements to that awful reality.1
Expand All Comments
In FB land if there are many comments you only see the most recent. And if there are many, many comments you have to keep hitting “View Previous Comments” over and over. That’s super boring to do once. If you have to do it a lot it would really suck. Enter Alec’s bookmarklet. I tweaked it a tiny bit because I think FB changed the wording but it works like a charm.
You’d copy the text below. Add a bookmark and then click edit. Replace the URL with this text and name it whatever you want.
Grab All Comments
Now to grab all these enlightening comments . . .
Install the Scraper Chrome Extension. You can now right click a particular item and choose “scrape similar.” It’ll pull up a grid of stuff chosen via xpath that’s similar to what you clicked on. You can then export to Google Drive or copy to your clipboard. There’s a quick video of what it looks like in action below.
1 If you must punch yourself in the face at least do it for a shorter duration.