Command-line client for Facebook
Textbook
The Ruby-based Facy command-line client lets you display Facebook streams at the command line, as well as comment and post messages. However, getting there can be tricky.
Command-line tools for Twitter have been around for a while, and in many varieties, but users previously searched in vain for a matching Facebook tool. Now, Facy [1] takes Facebook to the command line, giving users the ability to handle typical interactions without a browser. Currently, no package is available for installing the software, so you need to install Facy from the sources hosted on GitHub. To see how this works on DEB-based distributions, check out Listing 1.
Listing 1
Install Facy
The next step is to create a developer account on Facebook and register the app there. To do this, visit the Facebook Developer page [2] and, in the Apps tab, select Register as a Developer. After entering your Facebook password and confirming the license agreement, a verification stage occurs during which Facebook texts you a confirmation code. After entering the code, the provider enables your account.
You should now see – again in Apps – an entry for Create a New App. In the Add a New dialog, you will first see a prompt asking you for which platform you want to develop an app. Click on Advanced Setup here. In the new box, enter the desired Display Name and Namespace. You can choose both freely, but the namespace must contain at least seven characters without any uppercase letters.
Finally, select a Category and then confirm the entry by clicking Create Application. You will first see a Captcha query, followed by a page with two strings: the App ID and the App Secret (Figure 1). To make them visible, click Show and then enter your Facebook password again.
You can now launch Facy by calling facy1.9
. First, the software queries the App ID and then the App Secret that you just generated. Following this, Facy opens another web page in which you grant the app the necessary permissions for reading and writing (posting). Next, you change back to Facy again and confirm the prompt. The program then opens a page with the User Token and the App Token. Finally, you can copy the user token and pass it in to Facy.
Ready for Work
At this point, the software opens a connection to the Facebook servers and shows you the message stream (Figure 2). Each message starts with a unique variable in square brackets, for example [$yp]
. Facy understands several commands that you pass to this variable to respond to a particular post. For example, to "like" the post identified as [$yp]
, you would type :like yp
. An overview of all commands that Facy understands is output when you type :commands
. The most important of these commands can be found in Table 1.
Table 1
Facy Commands
Command | Action |
---|---|
:post |
Post entry |
:like |
Like post |
:open |
Open post in browser |
:comment |
Comment on post |
:mailbox |
Open messages |
:seen |
Mark a message as read |
:view_img |
Show photo as ASCII art |
:view_comments |
View comments for a post |
:clear_cache |
Empty the cache |
:help <command> |
Show help for command |
:exit |
Quit Facy |
The :post
command lets you create a new entry, and :comment
lets you add a comment. Facy marks posts with photos with a {photo}
tag at the end of the post.
Using :view_img <ID>
(e.g., :view_img yp
), the software loads the image, converts it to ASCII, and displays the results. Facy uses RMagick [3] (Ruby and ImageMagick) for this task, which explains why the software needs the libmagickwand-dev package as a dependency. The display quality shows that this is more of a gimmick, because the images are badly pixelated and distorted. Fortunately, Facy offers the opportunity to view posts in a browser at any time by typing :open <ID>
.
Facy does not fare so well when it needs to handle messages: Although :mailbox
opens an overview of your personal messages, we were unable to open the messages in our lab.
Conclusions
Facy is certainly not an adequate substitute for the web version of Facebook. However, if you just want to take a look at a stream, the program delivers what you need.
Infos
- Facy: https://github.com/huydx/facy
- Facebook Developer page: https://developers.facebook.com/
- RMagick: https://rubygems.org/gems/rmagick
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.