Meme Sharing Protocol
Find a file
2017-02-13 16:58:58 +01:00
meme PROOF OF CONCEPT OH YEAH 2017-02-13 16:58:58 +01:00
LICENSE initial commit 2017-02-13 16:02:18 +01:00
README.md PROOF OF CONCEPT OH YEAH 2017-02-13 16:58:58 +01:00

msp - Meme Sharing Protocol

Welcome to the future of meme sharing

This is a joke. I should be doing more productive things.

--- connection begins ---
> aul
> ti piacciono i mem
< ofx
> https://www.youtube.com/watch?v=ZbM6WbUw7Bs
< xd
--- more meme sharing and approval/denials ---
> kmaron
< nardino hype
> rip
< rip
--- connection closed ---

Why

Humans nyo and howl used to share memes to each other manually, by using a way similar to the example sharing protocol.

This has become an unbearable amount of manual work, so in order to better share our memes I've come up with a solution: the Meme Sharing Protocol.

Details

Commands are case insensitive (rip is same as Rip, aul is same as Aul).

Messages should be terminated by a newline.

Client shares memes to the server.

Server should take connections from 7475 by default. Why is that? "hacker" in base 36 is 1,045,307,475, and the last four numbers are 7475. Yes.

Starting a connection

First TCP message client sends should be either aul or nio. This of course comes from our usernames (Howl and Nyo), but being written in a very ignorant form.

If the client's first message isn't aul or nio, the server may close the connection.

Sharing a meme

Client must send ti piacciono i mem as a message to get the server's approval to send a meme. There are three kind of allowed responses in this case:

  • ofx, the most standard response, is when the server is available to receive a meme.
  • ofc, the less common response, is an alias to ofx.
  • no is a very rare response, and should be used only when you predict it's gonna be a very bad meme, you're not gonna like it or it's not the right time to send a meme.

Unless no is given, the client should then proceed to sharing the meme. The client can also ask if the server likes a specific kind of meme, using the format quelli di <category>, after which the server has to respond using the three responses mentioned above. The decision of what memes to accept and what not is arbitrary of implementation and configuration, but generally speaking quelli di haitai should never be accepted, while quelli di basilio or quelli di stampa piede should always be accepted. Up to you, though.

Once the meme has been shared, the server can reply with either of these responses:

  • A random sequence of uppercase letters of variable length, especially the letters A and H, with no punctuation (except spaces), to express extreme appreciation. May increase in length to express a lot of appreciation for the meme. But like, a lot.
  • xd, to express neutrality or slight like towards the meme.
  • kskf, to say you didn't like the meme.
  • low quality meme if the server really didn't like it.

Trivia

"ti piacciono i mem?" is Italian for "do you like mems?". Ofx was originally a deviation from the more standard response ofc, which obviously means of course, but as ofx is cooler, kinda like SpaceX, we decided to have ofx to be the more standard Meme Accepting Response.

Stopping a connection

Of course, a client may stop the connection by simply closing it, however that's brutal and how the server responds to it is an implementation-defined behaviour. If the server feels like it, they may start a game of Overwatch, go grief a minecraft server, or eat an eggplant. Or whatever else you could think of.

The official way to stopping a connection safely is the sequence specified in the example, and that is:

> kmaron
< nardino hype
> rip
< rip

The server must then close the connection.

Invalid messages

If the client sends invalid messages, these should be plain ignored. If the server expects a response of a certain type and does not get one, the server should reset the state of the connection to being initialised (as in, the state after aul or nio is said by the client).

Proof of Concept

go get zxq.co/howl/msp/meme
meme take

then go in another terminal and telnet localhost 7475. Have fun!