Facebook command line interface
gem install facebook-cli
The following steps are necessary to use the Facebook API:
- Create a new application at: https://developers.facebook.com/apps
- In the "Settings" tab, set "Site URL" to
http://localhost
and then addlocalhost
to the "App Domains" - In the "App Review" tab, flip the switch to make your app live. This is required for the content you publish through this app to be visible to other users.
- Save the App ID and App Secret by running:
facebook-cli config --appid=<app-id> --appsecret=<app-secret>
facebook-cli login
facebook-cli likes
Running facebook-cli help
shows the list of available commands:
COMMANDS
config - Save Facebook application ID and secret
event - Show event details
events - List your upcoming events
feed - List the posts on your profile
friends - List the people you are friends with (some limitations)
help - Shows a list of commands or help for one command
likes - List the pages you have 'Liked'
links - Some useful URLs
login - Log into Facebook and receive an access token
logout - Deauthorize your access token
me - Show your profile information
pastevents - List your past events
photos - List photos you have uploaded
photosof - List photos you are tagged in
post - Post a message or image to your timeline
postlink - Post a link to your timeline
postvideo - Post a video to your timeline
videos - List videos you have uploaded
videosof - List videos you are tagged in
Running facebook-cli help <command>
may reveal more details.
The output can easily be converted to an HTML document using a Markdown renderer. For example, with Pandoc:
facebook-cli likes | pandoc -s -f markdown_github > likes.html
Facebook has removed a large portion of their Graph API starting with version 2.0. Niraj Shah has done a fantastic job documenting the cutbacks and their implications in these blog posts:
- Facebook API: Graph API v2.4 Released, Removes Groups, Notifications and Stream Permissions
- Facebook Announces Graph API v2.3, More Deprecations
- Facebook API: Getting Friends Using Graph API 2.0 and PHP SDK 4.0.x
With so much functionality removed, it's not possible to build a full-featured interface to Facebook using the API.
If you can get a feature to work, open a pull request.
Install dependencies with Bundler:
gem install bundler
bundle install
MIT