Git Product home page Git Product logo

facebook-group-scrape's Introduction

Facebook Group Scrape

Code for collecting data on any public Facebook group.

Quick Start: Doing a test run from docker

docker pull mchirico/facebook-group-scrape

Create a tmp dir

mkdir -p tmp

Once the image is downloaded, run it.

docker run -it -v `pwd`/tmp:/tmp/data mchirico/facebook-group-scrape /bin/sh -c 'cd src && ./mainRun.sh'

2016-05-28
2016-06-04
2016-06-11
2016-06-18
2016-06-25
...

The command above creates the file database.sqlite. You can copy this file out after you get the container id from the "docker ps -a" command. Note below my id was 11b4f36b58a0. Obviously your id will be something different.

docker ps -a

CONTAINER ID        IMAGE                            COMMAND                  CREATED             
11b4f36b58a0        mchirico/facebook-group-scrape   "/bin/sh -c 'cd src &"   About a minute ago  

# Now bring the database.sqlite file to your host
# My id was 11b4f36b58a0. Yours will be different

docker cp 11b4f36b58a0:/src/data/database.sqlite .

At this point you should have data from 2016-05-28 from the Facebook Group "Unofficial Cheltenham Township", Facebook group id 25160801076. You can put your own group id in tokenf.py

cat tokenf.py

TOKEN='173263836xx..D4'  # <--- This token may have expired. Replace with your own.
...
FACEBOOK_GROUP='25160801076'  # <----- Set to the group you want.

Note. You shoud set your own TOKEN. It's likely that after 90 days the TOKEN in this docker file will have expired.

If you're having trouble getting the group id, view the Facebook page source and look for group_id. For example, https://www.facebook.com/groups/TheCheltenhamChronicle.org/ has the group_id=999833573397613.

That's it. You're done the quick run of the prototype.

Reference:

Here's an example of getting the group id.

Going Further

If you don't want to run this from a Docker image, you'll need to install Pandas. You can look at the requirement.txt file. This is setup for Python 2.7

Step 1: Obtain a Token

You probably want to use an App toke, since it will stay valid for a few months.

https://developers.facebook.com/tools/explorer

a. Select an App in the drop down box. Or add a new App and select.

b. Select 'Get App Token'

 You'll want to paste this token in the file tokenf.py. Or, you 
 can use my token.

Step 2: Get Your GroupID

a. The groupid goes in tokenf.py

    FACEBOOK_GROUP='25160801076'

facebook-group-scrape's People

Contributors

mchirico avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.