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
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
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.