Spam, REST & Async
Someone once asked me what the benefit of the REST model of web services over the RPC (Soap, & XML-RPC) model. I’ve never been very good at answering, and I’m not sure this does, but I think it hilights the simplicities possible with REST.
Well as I was lying in the sweltering heat this morning thinking about how to handle spam, and particularly web based spam, I thought of a simple, clear, asynchronous REST application.
Posting to IMC is slow enough already, what with the bandwidth sometimes saturating, PHP talking to Postgres, and the obvious overhead of uploading video, we don’t want to do anything to slow down that process, even something relatively light weight like querying a DCC server.
However, we could send the body of a message to the DCC server when the message is posted, perhaps adding it on the end of a queue of messages waiting to be inspected, and then if we hear back that it is spam, we can snag it back (a nice feature of the web, that email lacks)
Imagine we have a new article posted to:
http://www.indymedia.org/article/45287
With the proper access one can edit this article at:
http://www.indymedia.org/article/45287/edit
Or flag it as spam by visiting:
http://www.indymedia.org/article/45287/edit/isspam
Now we check if an message is spam by POSTing the body of the message to:
http://dcc.indymedia.org/tofu
Along with the body of the message we also send the URL:
http://www.indymedia.org/article/45287/edit/isspam
And if DCC decides its spam, then is GETs the included URL