1. Facebook

You can access most of Facebook’s main features from your Linux, Mac, or Windows command line with fbcmd.

Installation

You need to have PHP installed on your system before you can install FBCMD. Once you’ve gotten that out of the way, go ahead and grab the file “fbcmd_update.php”; you can manually download it here or run the following command: Next run these two commands: FBCMD is now installed, but you still need to perform a series of steps to authorize it to access your Facebook account. In your default web browser, log in as the user you want to perform the authorization for. This command will then take you to the basic authorization page:

Click “Go to App”; you should be taken to a page that says “Success.” FBCMD still needs authorization to access your account offline. Run: When this page opens up in your default browser, click “Generate”:

Facebook will then give you an authorization code, which you only need for one-time use. Copy the code and run: If all goes well, you’ll receive a friendly “Welcome to FBCMD” message in your terminal. Finally, grant FBCMD default permissions with: This will take you to yet another web page, where you must hit the “Allow” button. Now you can proceed to using FBCMD.

Usage

All FBCMD commands start with fbcmd, followed by an argument. Simply type fbcmd to view all the possible commands. Some examples include:

Update your status: fbcmd status “I’m totally updating my Facebook status from the command line!” Read your messages: fbcmd inbox Post on your friend Buddy Pal’s wall: fbcmd wallpost “Buddy Pal” “Wanna rage this Monday night?” RSVP to an event: fbcmd rsvp [event_id] yes|no|maybe

2. Twitter

Look no further than the Perl program TTYtter for your command-line Twitter experience. TTytter even supports the StatusNet and Identi.ca APIs in addition to Twitter.

Installation

Prereqisites include Perl 5.8.6 or newer and either Lynx or cURL. As of the day I’m writing this article, the latest stable version of TTYtter is 2.0.4 (from October 4, 2012). I recommend downloading the public beta (2.1) instead, as it is compatible with the latest changes in Twitter’s API. To get the beta, cd into your desired installation directory and run: The authorization wizard will start in your terminal. Following the wizard’s instructions, visit the authorization page in your browser.

Generate the PIN and enter it in your terminal following the prompt. By default, the keyfile will be saved as “.ttytterkey” in your home directory.

Usage

If you installed TTYtter in a system directory such as /usr/bin, you can run it simply by typing ttytter. Otherwise, you’ll have to either specify the full path of the executable when you run it or add its directory to your $PATH environment variable. If your terminal supports ANSI colors, start TTYtter with ttytter -ansi. The ttytter command lists recent posts from the users you follow and then opens an interactive session. At the prompt, you can type /help to list commands or /quit to exit. Here are some basic commands:

Make a status update by simply typing it into the prompt: I’m tweeting from my headless server! Refresh to see the newest tweets from the users you follow: /refresh Display a user’s profile information: whois [username] View your replies and mentions: /replies Search Twitter: /search [term]

For more TTYtter commands and information about scripting TTYtter, see the official documentation. Happy tweeting! Hungry for more ways to use the command line for social media? Stay tuned for Part 2!