实时更新postDate

So i make a script that shows new posts in real time like Twitter and Facebook. That was easy i just grab the last postID and chek for new every 30 sec but i dont how to change the postDate. If it was only one post ok , but how to do it if there is 20 posts in one page ?

You shouldn't refresh or make ajax requests every 30 sec best way is to use websockets.

The thing with websockets is that you create a connection client with server and than when something new is posted the server himself will tell the client that something new was posted. That way you dont make any wasteful requests every X seconds.

Check out HTML5 WebSockets for real time updates

http://www.tutorialspoint.com/html5/html5_websocket.htm