Although theoretically possible, it would be extremely hard in practice. There are simply way too many different options to be able to give you some example code.
If you use Particle.variable(), you need to poll with the server. Using SSE, you need to have a listener. Using webhooks, you'd have to have an API on the server which can be reached. TCP/IP requires yet another setup.
Then there are the different languages that can be used, and the different server set-ups. The LAMP stack is the 'old trusted' one, but node.js servers are quickly gaining popularity for these kinds of applications.
Taking the above into considerations, I'd be inclined to say:"no, we can't give you any example code". That is, without you telling us what you're planning on using, it's a way too broad of a request.
What kind of server setup are you planning to use, and in which language are you planning to program it?