Imagine opening up a command window on your PC, typing a single line command, and posting instantly to Facebook without even opening up a browser or other app.

It's definitely the fastest way to post to Facebook, but how do you set it up? And why not just use the tried and true method everyone always used to use called FBCMD, created by Dave Tompkins over at the University of British Columbia?

Well, the truth is that as of April 2015, FBCMD died. Not only did Dave quit updating the program, but Facebook made enough changes that it completely broke the functionality of the app.

What Happened to FBCMD?

According to a statement made by Dave Tompkins at his project website, he hinted at a combinations of reasons for ending the project -- partly to do with personal time management concerns, but partially to do with changes with Facebook itself.

curl-facebook1b

What made me discover Dave's statement was the fact that I could no longer get FBCMD to authenticate. Every time I attempted to authenticate, I received a strange new error code. Here's what he wrote:

"I started this project in 2007, when both Facebook and I were very different.

  • I am now raising a family and have a demanding job. When I do get precious "free" time, there are other projects I'd rather spend my time on.
  • I stopped using FBCMD myself. I log in to Facebook once a week and lurk around for a bit, but I rarely interact or share anything.
  • Facebook is moving away from apps that have broad access and permissions.
  • It was too frustrating to keep up with Facebook perpetually deprecating features and changing its API.

The straw(s) that broke the camel's back were: deprecating API 1.0, removing offline_access and changing the authentication model."

Another useful application, providing users with easier access to the social network from anywhere, bites the dust. Thanks a lot, Facebook.

Post to Facebook From Command Prompt

Have no fear! Just because FBCMD is dead doesn't mean you are not able to post to Facebook from a command prompt. In this article I'll show you how to do it using a "curl" command on either Windows or Linux, and IFTTT to pass the command on to Facebook.

Step 1: Download and Install Curl for Windows

If you're doing this on a Windows PC, you're going to need to install curl from the project's website.

The best bet is to go with the Download Wizard, which lets you choose what operating system and other details so that you get the right installation file.

curl-facebook1

In the case of Windows, you're likely to get a zipped download with several versions for 32-bit or 64-bit Windows.

curl-facebook3

It's worth opening a command prompt and testing each one to see which version works on your system (there are two for 64-bit, but only one version for 32-bit). See the installation instructions below to see how to test if it works.

Once you find the working version, copy it to a local directory. In my case, I just created a folder called c:\curl\ and put all of the files in there.

curl-facebook2

How do you know if CURL works? All you have to do is open a command prompt, navigate to the directory where your files are stored, and type "curl.exe".

curl-facebook4

If you get the response above, then you know it works.

As one more test, type the command followed by any website. If curl works on your system, you should get the page HTML back. This is what it looked like after I typed "curl https://www.makeuseof.com".

curl-facebook5

Once you know it's working, you're going to want to ensure curl is always configured to work every time you start up your computer.

Doing this is actually pretty easy. Go into Task Manager by clicking on Run and and typing "taskmgr".

curl-facebook1c

In Task Manager, click the Startup tab, click on File from the menu and choose Create New Task.

In the Open: field, type in the path where you placed the curl executable. In my case that's "c:\temp\curl\curl.exe"

curl-facebook6

So that you can run your command anywhere and from any directory, you're going to want to set "c:\temp\curl\" as an environment variable. You can do this by going into the Control Panel, clicking on System and then clicking on the Advanced tab.

Click on the Environment Variables button, under the system variables pane, scroll down the the Path variable. Double click on this so that the Edit System Variable popup appears. At the end of the long Variable value string, append the path where your curl executable is stored, preceded with a ";".

curl-facebook7

Now, just reboot your computer, and Curl is not configured to launch whenever your computer starts. You can run Curl commands from any command prompt at this point.

Step 2: Configure IFTTT Maker Channel

Now it's time to set up a Maker Channel on IFTTT to receive your Curl POST command. The steps to set up a Maker Channel on IFTTT are really well laid out on the Maker Channel page of IFTTT.

Here is the key line on that page. You need to make sure that you use the syntax shown on the page in the command that you type on your computer.

curl-facebook8

The "{event}" bit is the name of the event that you've created in your Maker channel (see below). The key at the end is the long key code that you'll see on the Maker Channel page.

So, when you create a new recipe with the Maker Channel as a trigger, you need to name the event, and then make note of what you called it. In this case I created an event called "post_facebook" that I'll use to create a new post on Facebook.

curl-facebook9

The Facebook trigger I chose is obviously to create a new status message on my timeline.

Further down in the recipe, you'll see that you can issue the exact message you want by sending the recipe a value labeled "value1". You need to define this in the Status message field when you're creating your recipe.

curl-facebook10

Now that your IFTTT recipe is ready and waiting for your incoming POST command via the Maker channel, you're good to start posting to Facebook with the command prompt!

Step 3: Post Using CURL Commands

For the Maker channel to correctly recognize your POST command, you need to format it correct. Place the event name in the correct position in the URL. As you can see below, my event name is "post_facebook" with the key pasted after the "/key/" part of the URL.

curl-facebook11

The post text is important to get right. Since this is going over as a URL string, you can't just put spaces where spaces would normally go. The trick to get around that is inserting "%20" everywhere in your post where a space would go.

To post "My first post using a curl command" to my Facebook timeline, my CMD command looks like this:

curl-facebook12

And almost immediately, my command prompt initiated post appeared on my Facebook timeline, just like that.

curl-facebook13

Now, if you think about it, posting to Facebook via a command line is only the beginning of some really cool stuff.

You could easily create batch jobs to run on your PC automatically, that posts anything you like on a fixed schedule. Better yet, use Windows Scripting or a VBA macro in Excel or Word to kick off automated Facebook posts!

The possibilities are endless, and we may explore a few creative integrations using this approach in some upcoming posts. Want to see any specific ones? Request them in the comments section below! Let's talk about the cool things you can now do that you can post to Facebook from the command line, even without FBCMD.