I need to write a program that monitors the transactions that sent to me. My approach is to periodically (like every 2 minutes) call the Ripple public api to get transactions for my account. But on the developer doc, I find two way to achieve this:

WebSocket/Json-RPC API. send to s2.ripple.com:443 with websocket or http. example:

{ "id": 1, "command": "account_tx",

"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",

"ledger_index_min": -1,

"ledger_index_max": -1,

"binary": false, "count": false,

"limit": 10, "forward": false }

I didn't check carefully, but they seem to have same response(with different format).

My question is :