Coder Social home page Coder Social logo

api-graph-facebook's Introduction

FACEBOOK API GRAPH

It's a API services to retrieve the profile of one facebook user, using the Facebook API Graph.

HOW TO INSTALL:

Download the source code:

$ git clone https://github.com/maurobonfietti/api-graph-facebook.git
$ cd api-graph-facebook/
$ cp .env.example .env

Edit and complete the config file .env, and then execute:

$ composer install
$ composer start
$ composer test

IMPORTANT NOTE:

For security reasons, I do not publish my FACEBOOK_APP_ID and FACEBOOK_APP_SECRET data on git.

Therefore, if you want to use this service, you will need to complete with your own valid data. In order to do this, you need to register in Facebook developers website: https://developers.facebook.com/apps.

  • So, first get your App Id (and App Secret Key).
  • Then, edit and complete the config file: .env:
FACEBOOK_APP_ID = '{YOUR-FB-APP-ID}'
FACEBOOK_APP_SECRET = '{YOUR-FB-APP-SECRET}'
FACEBOOK_APP_VERSION = 'v2.9'

HOW TO USE:

Requests Examples:

Get facebook profile from user '1234':

$ curl http://localhost:8080/users/1234

Response:

Status: 200 OK

{
    "id": "1234",
    "first_name": "Senait",
    "last_name": "Tesfai"
}

Get information about a facebook fan page like 'github':

$ curl http://localhost:8080/pages/github

Response:

Status: 200 OK

{
    "id": "262588213843476",
    "name": "GitHub",
    "about": "GitHub is how people build software.",
    "link": "https:\/\/www.facebook.com\/GitHub\/"
}

RUN TESTS:

Access the root of the project and run all tests PHPUnit with composer test.

$ cd api-graph-facebook/
$ composer test
> phpunit
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

........                                                             8 / 8 (100%)

Time: 1.94 seconds, Memory: 6.00MB

OK (8 tests, 29 assertions)

WHAT'S NEXT:

Coming soon Maybe (depending on my work time and family :-)), I'll add more useful features, using the Facebook API Graph.

You can read more information about this API Documentation in Facebook for Developers website

api-graph-facebook's People

Contributors

maurobonfietti avatar

Watchers

 avatar

Forkers

sebasnob

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.