• wiki page about RSS not applicable to webv4

    From LaF0rge@1:103/705 to DOVE-Net.Synchronet_Sysops on Thu Dec 19 13:18:41 2024
    Hi all,

    I wanted to add RSS feeds for some of my message areas, but it seems the
    wiki page at https://wiki.synchro.net/config:rss.ini covers an earlier
    web interface and not the current webv4.

    I had the impulse to mention that on the wiki page to avoid anyone else
    falling into that trap, but it seems the mediawiki account registration
    for wiki.synchro.net is not public, so I couldn't create an account and
    hence not add a disclaimer.

    I did a poor-mans-attempt of copying the rss.ssjs file to webv4/root
    and it seems I can then get a list of the channels at https://c3bbs.retronetworking.org/rss.ssjs - but when selecting any of
    the channels will run into JavaScript errors.

    Basically the msgbase.get_msg_header(true,total_msgs-i); will return
    null, as will the msgbase.get_msg_body(true,total_msgs-i);

    So I'm bringing up two topics:

    1) can the wiki pages related to web interface be expanded to clearly
    mention which of the web interface versions they relate to?

    2) did anyone get the rss.sjjs to successfully read the messages from
    the message base in recent synchronet versions?

    Thanks in advance,
    Harald
    --
    - Harald Welte <laforge@gnumonks.org> https://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option."
    (ETSI EN 300 175-7 Ch. A6) ---
    þ Synchronet þ My Brand-New BBS
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From LaF0rge@1:103/705 to All on Thu Dec 19 14:14:43 2024
    Hi all,

    following-up to the second part of my earlier message:

    LaF0rge <laf0rge@c3bbs.retronetworking.org> wrote:
    2) did anyone get the rss.sjjs to successfully read the messages from
    the message base in recent synchronet versions?

    I managed to make it generate a working RSS feed using the following diff, containing two changes

    a) adjusting the URLs to the scheme of the webv4 frontend

    b) fixing an off-by-one for msgbase.get_{msg_header,body}

    I'll see if I can create an account + post PRs on gitlab.synchro.net; at least the second part is an outright fix, even for the old web UI.
    --
    - Harald Welte <laforge@gnumonks.org> https://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option."
    (ETSI EN 300 175-7 Ch. A6) ---
    þ Synchronet þ My Brand-New BBS
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From LaF0rge@1:103/705 to All on Thu Dec 19 14:15:58 2024
    LaF0rge <laf0rge@c3bbs.retronetworking.org> wrote:
    I managed to make it generate a working RSS feed using the following diff, containing two changes

    Sorry, forgot the diff in the previous message

    --- repo/web/root/rss.ssjs 2024-12-09 12:57:20.024584412 +0000
    +++ webv4/root/rss.ssjs 2024-12-19 14:12:42.310672917 +0000
    @@ -10,7 +10,7 @@

    //log(LOG_INFO,"Synchronet RSS " + REVISION);

    -var link_root = "http://" + http_request.header.host + http_request.request_string;
    +var link_root = "https://" + http_request.header.host + http_request.request_string;

    var ini_fname = file_cfgname(system.ctrl_dir, "rss.ini");

    @@ -172,7 +172,7 @@
    writeln('\t\t<lastBuildDate>' + last_msg.date + '</lastBuildDate>');
    }
    var total_msgs = msgbase.total_msgs;
    - for(i=0;i<total_msgs;i++) {
    + for(i=1;i<=total_msgs;i++) {
    var hdr = msgbase.get_msg_header(true,total_msgs-i);
    if(!hdr || hdr.attr&MSG_DELETE)
    continue;
    @@ -190,8 +190,8 @@
    if(this.login==undefined) // v3.12a
    writeln('\t\t\t\t<link>' + link_root + (defaults.useentities ? '&amp;' : '&') + 'item=' + hdr.number + '</link>');
    else // v3.12b
    - writeln('\t\t\t\t<link>' + 'http://' +
  • From Digital Man@1:103/705 to LaF0rge on Thu Dec 19 11:54:45 2024
    Re: wiki page about RSS not applicable to webv4
    By: LaF0rge to DOVE-Net.Synchronet_Sysops on Thu Dec 19 2024 01:18 pm

    Hi all,

    I wanted to add RSS feeds for some of my message areas, but it seems the wiki page at https://wiki.synchro.net/config:rss.ini covers an earlier
    web interface and not the current webv4.

    There's really nothing particular to the web interface. The rss.ssjs file is in the web/root directory but can be just be copied or symlinked to a different web/root directory if that's what you're using.

    I had the impulse to mention that on the wiki page to avoid anyone else falling into that trap, but it seems the mediawiki account registration
    for wiki.synchro.net is not public, so I couldn't create an account and hence not add a disclaimer.

    It's dokuwiki :-) And all you need is an account on Vertrauen to login to wiki.synchro.net, and you have one: C3BBS.

    I did a poor-mans-attempt of copying the rss.ssjs file to webv4/root
    and it seems I can then get a list of the channels at https://c3bbs.retronetworking.org/rss.ssjs - but when selecting any of
    the channels will run into JavaScript errors.

    It seems to be working for me:
    var hdr = msgbase.get_msg_header(true,total_msgs-i);
    if(!hdr || hdr.attr&MSG_DELETE)
    continue;


    Basically the msgbase.get_msg_header(true,total_msgs-i); will return
    null, as will the msgbase.get_msg_body(true,total_msgs-i);

    So I'm bringing up two topics:

    1) can the wiki pages related to web interface be expanded to clearly
    mention which of the web interface versions they relate to?

    2) did anyone get the rss.sjjs to successfully read the messages from
    the message base in recent synchronet versions?

    Thanks in advance,
    Harald
    --
    digital man (rob)

    Sling Blade quote #6:
    Karl: he should've had a chance to grow up. He would had fun some time.
    Norco, CA WX: 82.4øF, 13.0% humidity, 3 mph W wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to LaF0rge on Thu Dec 19 12:03:18 2024
    Re: wiki page about RSS not applicable to webv4
    By: LaF0rge to DOVE-Net.Synchronet_Sysops on Thu Dec 19 2024 01:18 pm

    Sorry, I prematurely saved that last response.

    Basically the msgbase.get_msg_header(true,total_msgs-i); will return
    null, as will the msgbase.get_msg_body(true,total_msgs-i);

    This logic here should just ignore/skip any message headers that can't be read (returned as null):

    var hdr = msgbase.get_msg_header(true,total_msgs-i);
    if(!hdr || hdr.attr&MSG_DELETE)
    continue;

    a null 'hdr' would match the "!hdr" condition and just be skipped, with no error.

    So I'm bringing up two topics:

    1) can the wiki pages related to web interface be expanded to clearly
    mention which of the web interface versions they relate to?

    I think I see what you're saying, the message URLs are pointing to msg.ssjs which is from the Legacy/Runemaster web interface. Sure, the wiki can be updated to clarify that.

    2) did anyone get the rss.sjjs to successfully read the messages from
    the message base in recent synchronet versions?

    It seems to be working here: https://web.synchro.net/rss.ssjs
    --
    digital man (rob)

    This Is Spinal Tap quote #41:
    Ian Faith: It says "Memphis show cancelled due to lack of advertising funds." Norco, CA WX: 82.0øF, 14.0% humidity, 2 mph WSW wind, 0.00 inches rain/24hrs --- SBBSecho 3.23-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)