Can a Mac be controlled using an API? I'm developing a plugin for Hubot (a scriptable chatbot) to take a URL, and display it on a Mac Mini connected to a TV in my office.

However I'm not actually sure how feasible this is. Hubot is able to send messages to APIs using HTTP. Is there a known method of allowing a Mac to listen for requests over HTTP, and then run a command (an applescript or shell script perhaps)?
Python is shipped with Macs, you can just use SimpleHTTPServer to respond to HTTP requests.