Command Line
for Facebook

Installation

Before you Begin

  • You will need to have PHP installed on your machine. (It's free!)
  • For Mac/Linux, it's probably already installed.
  • For Windows, see how To install PHP in Windows
  • To test your PHP environment, try typing at a command prompt:
    php -r "echo phpversion();"
  • While you're at it, make sure this outputs "1".  If not, visit troubleshooting.
    php -r "echo ini_get('allow_url_fopen');"
Installation Options

Windows

    Mac/Linux

    • Obtain the fbcmd_udpate.php program by executing: (or download it from the Downloads page)
      curl -O https://github.com/dtompkins/fbcmd/raw/master/fbcmd_update.php
    • Execute the following two commands:
      sudo php fbcmd_update.php sudo
      php fbcmd_update.php install

    Initial Test

    • Try the command:
      fbcmd
    • It should say you're not authorized.
    • (Mac/Linux) if it says command not found, try typing bash to restart your shell.  If that doesn't work check to see if /usr/local/bin is in your PATH: see how to add fbcmd to your PATH.

    Basic Access

    • Before you can obtain an authorization code, you need to grant FBCMD basic access to your Facebook account.
    • Visit this website to grant basic access.

    Authorization Code

    • After you've allowed basic access, you need to grant FBCMD authorization to use your Facebook account in offline mode.
    • This authorization is performed only once at installation: FBCMD stores your "authorization keys" in your data directory for future use.
    • Visit this website to get an AUTH code (we'll call it XXXXXX)
    • Run the command:
      fbcmd auth XXXXXX
      and you should hopefully get a success message.
    • Note: AUTH codes are time-sensitive and can only be used once. If one fails, visit the website and generate another
    Congratulations! You've installed FBCMD.
    You should check out the additional installation notes below, and then visit the Syntax page and the Commands page to see what you can do.

    Additional Authorization

    • To execute most commands in FBCMD, you need to grant additional permissions:
    • click (here) to grant FBCMD the default permissions, or use the ADDPERM command to fine-tune your permissions.
      Note: granting permissions does NOT allow other FBCMD users to access your personal information:
      These permissions are linked to your account and your authorization code above.
    • you can see what permissions have been granted with the SHOWPERM command.

    Comments

    Jeremy Osner - 4 Jan 2010 15:50

    Note that you can install fbcmd on a Linux system where you don't have sudo access; all you need to do is edit two settings in prefs.php before running fbcmd_update.php.
    install_lib_dir can be any directory you have write access to
    install_bin_dir needs to be on your path -- $HOME/bin/ should work.