Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Facebook

Yuri Schimke edited this page Jul 18, 2018 · 9 revisions

Facebook

Aliases

fbapi -> https://graph.facebook.com{0}

Authentication (developer)

Visit https://developers.facebook.com/apps/ and select the app you wish to use. Enter the Id, secret and scopes you need.

Facebook Developer App Secrets

$ okurl --authorize facebook
Authorising Facebook API
Facebook Client Id: 999999999999
Facebook Client Secret: 
Scopes: 

This should launch a web browser and after signing in and approving it should automatically call back and store the token.

Authentication (manual)

$ okurl --authorize facebook --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Queries

$ fbapi '/me?fields=id,name,albums.limit(5),posts.limit(5)'
{
  "id": "99999999999999",
  "name": "Bobby Bonson",
  "albums": {
    "data": [
      {
        "created_time": "2015-12-25T00:02:11+0000",
        "name": "Instagram Photos",
        "id": "99999999999999"
      },
      {
        "created_time": "2011-12-17T04:33:26+0000",
        "name": "Mobile Uploads",
        "id": "99999999999999"
      },
      {
        "created_time": "2011-11-12T09:10:28+0000",
        "name": "Timeline Photos",
        "id": "99999999999999"
      },

Show previews of images I've posted

$ fbapi /v2.7/me/photos?fields=images | jq -r '.data[].images[] | select(.height==130) | .source' | xargs okurl
Clone this wiki locally