How to autoupdate a forum thread when new posts?

感情迁移 提交于 2019-12-19 11:24:06

问题


Greasemonkey plugin. (js/ajax, jquery optional).

  • Want to autoupdate forum pages when they get changed (new posts, for instance). Ideally with no page refresh.
  • Additionally, if I can make it load multi-page threads in one page (when applicable, perfect).
  • Don't want to lose content in response boxes if there's any text in them.
  • Site: Paizo.com.

How would you guys go about doing this?


回答1:


loop GM_xmlhttpRequest to get the forum page in a 15 minutes interval.
save the response, and compare with the last one.
keep only the content that was added, and display it any way you see fit (i would use a div).

in this example here you can see how to use GM_xmlhttpRequest, create a DIV on the fly, store the desired content into it, and use its data as a parameter to request another page with GM_xmlhttpRequest again, repeating the cycle.

if you want me to explain the script, let me know.



来源:https://stackoverflow.com/questions/7945746/how-to-autoupdate-a-forum-thread-when-new-posts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!