How to autoupdate a forum thread when new posts?

后端 未结 1 931
轮回少年
轮回少年 2021-01-16 12:12

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

  • Want to autoupdate forum pages when they get changed (new posts, for instance). Ideally with no page refresh.<
相关标签:
1条回答
  • 2021-01-16 12:56

    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.

    0 讨论(0)
提交回复
热议问题