# Fb::Core Fb::Core provides methods to interact with Facebook users and pages through the Facebook Graph API. [](https://travis-ci.org/Fullscreen/fb-core) [](https://coveralls.io/r/Fullscreen/fb-core) [](https://gemnasium.com/Fullscreen/fb-core) [](https://codeclimate.com/github/Fullscreen/fb-core) [](http://www.rubydoc.info/gems/fb-core/frames) [](http://rubygems.org/gems/fb-core) The **source code** is available on [GitHub](https://github.com/Fullscreen/fb-core) and the **documentation** on [RubyDoc](http://www.rubydoc.info/gems/fb-core/frames). ### Installing and Configuring Add `fb-core` to your Gemfile and run `bundle install`. Most methods of this library require to have an access token of a Facebook user. If you need to obtain one programmatically, use the [fb-auth](https://github.com/Fullscreen/fb-auth) library. ## Usage Fb::User#email -------------- Given an user access token with the `email` scope, you can get the user's email by calling: ```ruby user = Fb::User.new access_token: '--valid-access-token--' user.email # => 'john.smith@example.com' ``` Fb::User#pages -------------- Given an user access token with the `manage_pages` scope, you can get the list of Facebook pages managed by the user by calling: ```ruby user = Fb::User.new access_token: '--valid-access-token--' user.pages # => [#<Fb::Page: id="1234", name="sample1">, #<Fb::Page: id="5678", name="sample2">] ``` ## Development To run tests, obtain a long-term access token for a Facebook user who manages at least one page and includes `email` and `manage_pages` scopes. Set the token as: export FB_TEST_ACCESS_TOKEN="YourToken" Then, run `rake spec` to run the tests. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). Thanks :tada: