dcsimg

FBCMD: Command Line for Facebook

What's better than the command line and Facebook? How about combining the two?

Just because you’re stuck at the command line all day long doesn’t mean that you can’t participate in the awesomeness of social networking. You can enjoy both with FBCMD, the command line Facebook applications. Back in February, I wrote Tweeting from the Command Line with Twyt, which, as you remember, was an article covering the command line Twitter client, Tywt. Now, you can have your Facebook and the convenience of the command line to satisfy your social networking addiction. And, better still is that at the command line, no one will ever suspect that you’re Facebooking. Power to the people! The command line-using people, that is.

The Basics

There are a few prerequisites for installing the command line Facebook application, FBCMD. PHP 5.x is a requirement, since the application is a single PHP file. You can install php5 via any method you wish but, in my experience, I had to install php5-cli, php5-gd, and php5-mysql to use this application. Your experience and mileage may vary.

Connect to the FBCMD and download the PHP file or grab it easily via curl.

$ curl -O https://github.com/dtompkins/fbcmd/raw/master/fbcmd_update.php

And, run the following two commands to complete this very simple installation.

$ sudo php fbcmd_update.php sudo

fbcmd update utility [version 2.91]

http://fbcmd.dtompkins.com/update

php fbcmd_update.php install

fbcmd update utility [version 2.91]

http://fbcmd.dtompkins.com/update

.....................

Update: COMPLETE!

fbcmd version: [none] --> [1.0-beta5-dev1]

Note: fbcmd_update.php is now at [/usr/local/lib/fbcmd/fbcmd_update.php]
so you can remove the old one at [/home/khess/fbcmd_update.php]

type fbcmd to begin

As the prompt suggests, type fbcmd and see what happens.

$ fbcmd

Welcome to fbcmd! [version 1.0-beta5-dev1]

This application needs to be authorized to access your facebook account.

Step 1: Allow basic (initial) access to your acount via this url:

https://www.facebook.com/dialog/oauth?client_id=42463270450&redirect_uri=http://www.facebook.com/connect/login_success.html

to launch this page, execute: fbcmd go access

Step 2: Generate an offline authorization code at this url:

http://www.facebook.com/code_gen.php?v=1.0&api_key=42463270450

to launch this page, execute: fbcmd go auth

obtain your authorization code (XXXXXX) and then execute: fbcmd auth XXXXXX

These messages explain the steps you need to take next to grant FBCMD access to your Facebook information.

Making the Facebook Connection

Perform the following connections from a Linux desktop system because some of these commands use Firefox (or your default browser) to initiate the connections and setup the application. Open a Terminal and type in the following commands.

fbcmd go access

Your Internet browser will open to Facebook and prompt you for login. If you see a link that reads, “Login with Command Line” or something similar, select that link and login to Facebook. If you don’t see that link, login to Facebook the way you normally do. Return to your Terminal window and issue the following command:

$ fbcmd go access

This command prompts another connection to Facebook, where you should see a six character code that you’ll need for the next step.

fbcmd auth XXXXXX

fbcmd [v1.0-beta5-dev1] AUTH Code accepted.
Welcome to FBCMD, Kenneth Hess!

most FBCMD commands require additional permissions.
to grant default permissions, execute: fbcmd addperm

As instructed, issue the command in the message.

$ fbcmd addperm

launching: https://www.facebook.com/dialog/oauth?client_id=42463270450&redirect_uri=http://www.facebook.com/connect/login_success.html&scope=create_event,friends_about_me,friends_activities,friends_birthday,friends_checkins,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationship_details,friends_relationships,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,manage_friendlists,manage_pages,offline_access,publish_checkins,publish_stream,read_friendlists,read_mailbox,read_requests,read_stream,rsvp_event,user_about_me,user_activities,user_birthday,user_checkins,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationship_details,user_relationships,user_religion_politics,user_status,user_videos,user_website,user_work_history

Your FBCMD to Facebook connection is now complete and you’re ready to use FBCMD. To test that assertion, try the following command to see the permissions you granted the application.

$ fbcmd showperm
PERMISSION                    GRANTED?
ads_management                0
create_event                  1
email                         0
friends_about_me              1
friends_activities            1
friends_birthday              1
friends_checkins              1
friends_education_history     1
friends_events                1
friends_groups                1
...
user_videos                   1
user_website                  1
user_work_history             1
xmpp_login                    0

A ’1′ means permission granted and a ’0′ means permission denied. You can change permissions at any time by issuing the addperm keyword and a permission. See the FBCMD Command Documentation for a complete listing of command keywords and syntax.

Using FBCMD

I can’t show you all of the FBCMD commands but I can show you a few of the fun ones. You can do almost anything with the command line interface that you can with the web interface. Your results may vary but generally speaking everything works pretty well. To see a list of your friends who are signed into Facebook, use fonline.

$ fbcmd fonline

NAME			ONLINE_PRESENCE
Friend One		idle
Friend Two		idle
Friend Three	        idle
Friend Four		idle
Friend Five		active
Friend Six		active
Friend Seven	        active

To see a list of messages that your friends have posted to your wall, use mywall.

$ fbcmd mywall
[#]  NAME          MESSAGE

[1]  Friend One  Hi , Hope you are good

You can read your Facebook messages with the inbox keyword.

$ fbcmd inbox
[#]   FIELD     VALUE

[1]   subject   [Hello]
      :to/from  Friend Four
      :snippet  Hi, what's up?

To check those annoying event invitations that people send you, use events.

$ fbcmd events
[#]  START_TIME        RSVP         EVENT
[1]  Wed May 25 02:00  not_replied  Towel Day - Celebrating Douglas Adams
[2]  Sat Jul 16 10:00  declined     William Bernhardt Small-Group Seminar
									(Level 3)

And, last but not least, you can update your status. You wouldn’t want anyone to miss any aspect of your fascinating existence or your latest video game scores.

$ fbcmd post "This is a test post from FBCMD"
POST_ID
1443542993_205008538849

If you’re a PHP programmer, I suggest that you expand and extend this application by contacting the primary developer. See the Contribute page for more information.

For those of you who love to use Facebook, you’re sure to love an easy to install, easy to use command line Facebook application like FBCMD. FBCMD has a lot of potential as an evolving command line application that I hope someone incorporates into a repository so that it’s even easier to install for those who don’t like to install applications. Those of us who like a challenge are in the minority. Most people just want something that works and works without hassle or strain. Make it so, Linux fans.

Comments on "FBCMD: Command Line for Facebook"

I see your website needs some unique & fresh content.
Writing manually is time consuming, there is tool for this task.

Just search in g00gle for – rilkim’s tips

I really like your writing style, wonderful info , regards for putting up : D.

You’ve really helped me understand the used car buying process. Buying a vehicle report is important!

There is noticeably a bundle to identify about this. I think you made certain nice points in features also.

Articles like these put the consumer in the driver seat-very important. Help avoid purchasing a dangerous used vehicle!

I never thought I would find such an everyday topic so enthralling!

If only there were more clever people like you! Buying a used car would be a snap!

This is the ideal answer. Everyone should read this. Do not buy a salvage car, run a vehicle report!

Articles like this make life so much simpler.T

Calling all cars, calling all cars, we’re ready to make a deal.

Hello! I simply want to offer you a huge thumbs up for the great info you’ve got right here on this post. I’ll be coming back to your website for more soon.

The root of your writing while sounding reasonable in the beginning, did not really work well with me after some time. Somewhere within the sentences you actually managed to make me a believer unfortunately just for a very short while. I still have a problem with your leaps in logic and you might do nicely to help fill in all those gaps. In the event you actually can accomplish that, I would undoubtedly end up being amazed.

I like this post, enjoyed this one appreciate it for posting .

Below you?ll uncover the link to some web-sites that we consider you’ll want to visit.

“I appreciate you sharing this article post. Really Cool.”

If you are constructing a new home or adding a storage to your
house, we may also help be sure that your garage door is put in properly and fast!

Hey there! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no back up. Do you have any solutions to prevent hackers?

I will give it some consideration. Currently, I am not looking for guest writers.

Leave a Reply