I am fascinated by the plethora of 'as a Service' services out there. Software as a Service, Analytics as a Service, Backend as a Service, Infrastructure as a Service, Transportation as a Service (LOL), and literally thousands of other made up terms to describe things that already maybe had a name. (Transportation as a Service == Taxis? Buses?). I didn't fully understand why the 'as a Service' paradigm was necessary until I found one that truly spoke to me.

Behold, Fuck Off as a Service (FOaaS). This is a REST API that this guy created to solve the very common problem of 'telling people to fuck off'. I understand the problem space so let's explore what this service can do for people like us.

Detour: What's an API?

Let's say I'm at home and I want a sandwich. I open up my fridge and find all the things that'll combine to create my masterpiece sandwich. I then put them together myself and voila, I have made a sandwich.

Now alternatively, I could buy a sandwich from a fast food restaurant. They don't want me touching their stuff so they'll make it for me. Also, they'll do it the way they do it; there's a system. All I have to do is order the sandwich. Oh and I'll have to order it off of their menu. Yes, there are certain exceptions that can be made (no pickles or whatever), and to be honest, this analogy could probably handle that stuff too but let's just keep it simple for now. No deviations from the menu.

The menu then, is the API. I don't really need to know where they put their bread, mayo, mustard, cheese, and all the other ingredients. I'm not the one that needs to go find them and put them together. All I need is the API (I mean...menu) so that I can say "gimme a number 6" and magically after a bit of a wait, my desired result appears.

In software, an API is what you use to interact with someone elses' software solutions. They promise a certain set of results and provide you with the 'menu' that you need to order off of to get those results. Ask for things in a specific way, and your desired outcome ensues.

Back on track: What's the deal with FOaaS?

FOaaS is a pretty simple API. It has a list of 'endpoints' that you can hit to get specific, predictable responses. All of these responses are variations of telling people to fuck off. You can test it in your browser. An endpoint is essentially just a URL that you can go to where your 'sandwich' will be waiting for you. Try it out now. Go to https://www.foaas.com/me/enter-your-name-here. There's behind the scenes code that inserts your name in the predetermined phrase and then displays it for you. You don't need to know how it's doing what it's doing, just that you can go to that endpoint and you will always get that result.

https://www.foaas.com/zero/Omar

https://www.foaas.com/maybe/Omar

https://www.foaas.com/cool/Omar

Try all of those (and sub your name for mine).

So yes, it's pretty basic but it works and there are tons of endpoints to pick from.

What I did with FOaaS.

So I used FOaaS and made something. It's not crazy but it was fun and it's fun to play with. Let me show you. First I have to tell you a bit about the Terminal.

This is the terminal:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5becbc9-547b-4116-bc50-af06191cf635/Untitled.png

Simply put, it's an application that lets you interact with your Operating System to do...stuff. You can do all kinds of things in the terminal. When it comes to programming, it's sometimes easier and more efficient to operate within the terminal for certain tasks than use some sort of GUI so you'll often see this window open when someone's coding something.

The terminal is particularly useful when it comes to automating repetitive tasks. For example, deleting all files in a folder that end with the '.png' extension. In a very large folder that could be super tedious to do manually, but the terminal lets you do it in one line by simply typing in the following: