How to create a listener for RSS json

HI
Can I create a listener for RSS json. I want to get a json in real time and put it into a panel.
I saw here is a way to put a json URL into dashboard, and it worked. but it must push a button to trigger it. The only way I thought is to create a time event, and trigger it by the time change. So I wonder if listener would be more effective
Parsing a local JSON file in Dashboard to get values for parameters

here is my way:

params.setValue('time', 0, event.getDisplay()); function callback(resultStr) { if (resultStr != null) { var json = JSON.parse(resultStr); var back = JSON.stringify(json); //ogscript.debug(back); params.setValue('dataOutput',0,back); } } ogscript.asyncPost(params.getValue('URL', 0), null, callback); ogscript.getTimerManager().getTimer('time').startTimer(true); ogscript.getTimerManager().getTimer('time').stopTimer(true); params.setValue('dataOutput',0,''); ​

Hi Ding,

Both the timer and listener are viable options however the timer is certainly easier to implement.

If you want to use a listener, you would need to write your own HTTP headers to the listener’s output stream on connection and parse the HTTP input on response.

I would suggest using the timer as opposed to the listener unless you know that the http server will continue to send updates over the same active http connection. As long as you aren’t experiencing any performance issues, the timer would probably be easier to implement/work with.

Please let me know if you have any questions.