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
-
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.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4
-
Fedora Unleashes Atomic Desktops
Fedora has combined its solid distribution with rpm-ostree system to make it possible to deliver a new family of Fedora spins, called Fedora Atomic Desktops.
-
Bootloader Vulnerability Affects Nearly All Linux Distributions
The developers of shim have released a version to fix numerous security flaws, including one that could enable remote control execution of malicious code under certain circumstances.