>The shlog is basically a daycare for autistic teenagers, most of us will just go back on discord or 4chan if you shut it down. And that would be sad
  • Welcome. Registering and having your account be approved may take a while since there's only one guy checking and approving accounts and guestposts
  • Boards are being moved around and added. Leave feedback in this thread and let jannies move your threads

AMA

An AMA thread
JavaScript:
// ==UserScript==
// @name         Soyjak.forum Auto-Refresh Notifications
// @namespace    https://greasyfork.org/
// @version      1.4
// @description  Refreshes the notification badge every 30 seconds on soyjak.forum without marking alerts as read
// @author       You
// @match        *://soyjak.forum/*
// @match        *://*.soyjak.forum/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    const INTERVAL_MS = 30000; // 30 seconds

    function isXenForo() {
        return (
            (typeof XF !== 'undefined' && XF.ajax) ||
            (typeof XenForo !== 'undefined' && XenForo.ajax) ||
            document.documentElement?.id === 'XF' ||
            document.documentElement?.id === 'XenForo'
        );
    }

    function poll() {
        // Prefer modern XF2
        if (typeof XF !== 'undefined' && XF.ajax && XF.canonicalizeUrl) {
            // Very light endpoint that still returns the visitor counters
            // (does NOT open or mark alerts as read)
            XF.ajax(
                'GET',
                XF.canonicalizeUrl('index.php?whats-new/latest-activity'),
                {},
                null,
                {
                    global: false,        // no spinner
                    skipDefault: true,
                    error: function () {}
                }
            );
            return;
        }

        // Fallback for older XenForo
        if (typeof XenForo !== 'undefined' && XenForo.ajax) {
            XenForo.ajax(
                'index.php?misc/lightbox',
                {},
                function () {},
                {
                    global: false,
                    error: function () {}
                }
            );
        }
    }

    if (!isXenForo()) return;

    setTimeout(() => {
        poll();
        setInterval(poll, INTERVAL_MS);
    }, 2000);
})();
Does it automatically update threads at that rate however?
 
If the polling rate is stored as an actual changeable number, just send it as is. If not, five seconds.
30 seconds might be to long tbh. Here is a 5 second one.
JavaScript:
// ==UserScript==
// @name         Soyjak.forum Auto-Refresh Notifications
// @namespace    https://greasyfork.org/
// @version      1.5
// @description  Refreshes the notification badge every 5 seconds on soyjak.forum without marking alerts as read
// @author       You
// @match        *://soyjak.forum/*
// @match        *://*.soyjak.forum/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    const INTERVAL_MS = 5000; // 5 seconds

    function isXenForo() {
        return (
            (typeof XF !== 'undefined' && XF.ajax) ||
            (typeof XenForo !== 'undefined' && XenForo.ajax) ||
            document.documentElement?.id === 'XF' ||
            document.documentElement?.id === 'XenForo'
        );
    }

    function poll() {
        // Prefer modern XF2
        if (typeof XF !== 'undefined' && XF.ajax && XF.canonicalizeUrl) {
            // Very light endpoint that still returns the visitor counters
            // (does NOT open or mark alerts as read)
            XF.ajax(
                'GET',
                XF.canonicalizeUrl('index.php?whats-new/latest-activity'),
                {},
                null,
                {
                    global: false,        // no spinner
                    skipDefault: true,
                    error: function () {}
                }
            );
            return;
        }

        // Fallback for older XenForo
        if (typeof XenForo !== 'undefined' && XenForo.ajax) {
            XenForo.ajax(
                'index.php?misc/lightbox',
                {},
                function () {},
                {
                    global: false,
                    error: function () {}
                }
            );
        }
    }

    if (!isXenForo()) return;

    setTimeout(() => {
        poll();
        setInterval(poll, INTERVAL_MS);
    }, 2000);
})();
 
Back
Top Bottom