Project

facegroups

0.0
No commit activity in last 3 years
No release in over 3 years
Extracts feed, postings, and attachments from FB groups
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.8
~> 4.4
~> 5.9
~> 11.3
~> 0.42
~> 0.12
~> 3.0
~> 2.1

Runtime

~> 2.0
 Project Readme

FaceGroups Gem

Gem Version Build Status

FaceGroups is a gem that specializes in getting data from public Facebook Groups.

Installation

If you are working on a project, add this to your Gemfile: gem 'facegroups'

For ad hoc installation from command line: $ gem install facegroups

Setup Facebook Credentials

Please setup your Facebook developer credentials by creating an app profile on Facebook Developer: https://developers.facebook.com - you should get a "client ID" and "client secret".

Usage

Require FaceGroups gem in your code: require 'facegroups'

Supply your Facebook credentials to our library in one of two ways:

  • Setup environment variables: ENV[FB_CLIENT_ID] and ENV[FB_CLIENT_SECRET]
  • or, provide them directly to FaceGroups:
FaceGroups::FbApi.config = {
  client_id: ENV[FB_CLIENT_ID],
  client_secret: ENV[FB_CLIENT_SECRET]
}

See the following example code for more usage details:

# Access the group
group = FaceGroups::Group.find(id: ENV['FB_GROUP_ID'])

puts group.name

feed = group.feed

puts feed.count

group.feed.postings.each do |posting|
  puts posting.id
  puts posting.created_time
  puts posting.message
  if posting.attachment
    puts posting.attachment.description
    puts posting.attachment.url
  end
end